Posts

Showing posts from September, 2012

java - Unable to load RSA public key -

i'm trying read rsa public key shown below, exception @ line 6: java.security.spec.invalidkeyspecexception: java.security.invalidkeyexception: ioexception: algid parse error, not sequence my code: string rsapublickey = rsapublickeystring.replace( "-----begin rsa public key-----\n", ""); rsapublickey = rsapublickey.replace("\n-----end rsa public key-----", ""); byte[] bytes = encryptionutils.decodebase64(rsapublickey); keyfactory keyfactory = keyfactory.getinstance("rsa"); x509encodedkeyspec keyspec = new x509encodedkeyspec(bytes); pubkey = (rsapublickey)keyfactory.generatepublic(keyspec); rsa public key: -----begin rsa public key----- miibcgkcaqeawvacpi9w23mf3tbkdzz+zwrzkoaaqdr01vabu4e1pvkfj4sqdsm6 lydons789svod/xcs9y0hkkc3gtl1tsftlgcmooul9lcixlekzwkenj1yz/s7das an9tqw3bfuv/nqgbhgx81v/+7rfaed+rwfnk7a+xyl9sluzhryvvattveb2gaztw efzk2dwgkbluml8oremvfrax3bkhzjtkx4eqsjbbbdj2zxisrryoxfaa+xayegb+ 8hdllmajbcvfaigxx0cdqwer1y

MS Access combo box setting a record with two primary keys -

i have database 2 primary keys, 1 line number , 1 phase of construction. reason have projects may use same line number must track several phases of project entirely seperatly. have combo box drive record information on form. works fine, when have more 1 phase bring line's first phase , not other 4 phases. when other phas 1 picked results first phase information. is there way tie combo box 2 fields select proper record based on both fields picked? or maybe need rething way form brought up... there better way this? code used select record: sub setfilter() dim lsql string lsql = "select * tbllinedata_horizon" lsql = lsql & " lineno = '" & cboselected & "'" form_frmhorizon_sub.recordsource = lsql end sub private sub cboselected_afterupdate() 'call subroutine set filter based on selected line number setfilter end sub private sub form_open(cancel integer) 'call subroutine set filte

loops - C difference between (++variable) and (variable++) -

i have c code here: char *cat_copy(char *dest, char *src) { char *start = dest; while (*++dest); //increment unless can't anymore. while (*src++) { *dest = *(src - 1); dest++; } return start; } i had use while (*++dest) work, instead of while (*dest++) . i read : "--" operator in while ( ) loop , in mind made sense use while (*dest++) . why doesn't work *dest++ ? , difference between *dest++ , *++dest . while (*++dest); this increments dest , checks if points terminating null byte of string. @ end of string, leave dest pointing terminating null byte while (*dest++); this increments dest , checks if did point terminating null, before incrementing happened . @ end of string, leave dest pointing character after terminating null. since in following copying part want overwrite original terminating null of dest , first version works better. the first version still has bug though. always i

ios - Pushing UINavigationController from a subview doesn't show properly -

i have segmentcontrol in uiviewcontroller embedded in uinavigationcontroller. i'm adding uiviewcontroller subview in 1 of segment uinavigationcontroller , pushing detailviewcontroller it. now problem is, i'm not getting pushed controller on top of existing view. how can achieve that? below code i'm using push viewcontroller subview. for segmentcontrol - if (segmentcontrol.selectedsegmentindex==1) { firstview = [self.storyboard instantiateviewcontrollerwithidentifier:@"firstviewcontroller"]; [self.view addsubview:firstview.view]; } after cell selection - - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { detailviewcontroller *detailview = [self.storyboard instantiateviewcontrollerwithidentifier:@"detailviewcontroller"]; [self.navigationcontroller pushviewcontroller:detailview animated:yes]; [tableview deselectrowatindexpath:indexpath animated:yes]; }

java - Getting around setter injection using mockito's @InjectMocks -

i have abstract class 2 map fields. 1 mock , inject object of subclass of abstractclass unit testing. other don't care about, has setter. public abstract class abstractclass { private map<string, object> maptomock; private map<string, object> dontmockme; private void setdontmockme(map<string, object> map) { dontmockme = map; } } when using @injectmocks, automatically tries inject in order: constructor, setter, field. checks if can inject in each of these places checking types, names if there multiple type possibilities. doesn't work me, because mocked maptomock injected dontmockme via setter. cannot edit abstract class. there way me around setter injection? thank in advance! well corner case, automatic injection won't work in way mockito injection designed. mockito suffer shortcomings when there multiple fields same types. so understand why doesn't work let's dive bit in way mockito performs injection :

c# - Stuck with two dimensional array -

i'm trying create booking service , i've been stuck on part many hours , can't figure out i'm doing wrong. so i've got 2 dimensional array , when trying print out stuff when testing , trying figure out what's wrong, system.string[] doesn't make me wiser. want able access details in i.e. m_namematrix[0,0] check whether seat reserved or not. here's snippet form code: private void updategui(string customername, double price) { string selecteditem = cmddisplayoptions.items[cmddisplayoptions.selectedindex].tostring(); rbtnreserve.checked = true; lstseats.items.clear(); lstseats.items.addrange(m_seatmngr.getseatinfostrings(selecteditem)); } and here 2 methods 2nd class: public string[] getseatinfostrings(string selecteditem) { int count = getnumofseats(selecteditem); if (count <= 0) { return new string[0]; } string[] strseatinfostrings = new string[count]; (int index = 0; index <= count; i

database - Neo4j 2.0.0 M3 Initialization Failure -

i've been using neo4j 2.0.0 m3 release past month or in developing simple web application. i've had absolutely no issues release until today when went start database. i'm bit of novice , having hard time determining cause of problem , how go fixing it. error log below, hoping in interpreting output. thanks! jul 23, 2013 11:10:16 org.neo4j.server.logging.logger log severe: java.lang.runtimeexception: org.neo4j.kernel.lifecycle.lifecycleexception: component 'org.neo4j.kernel.impl.transaction.xadatasourcemanager@b05236' initialized, failed start. please see attached cause exception. @ org.neo4j.kernel.internalabstractgraphdatabase.run(internalabstractgraphdatabase.java:319) @ org.neo4j.kernel.embeddedgraphdatabase.<init>(embeddedgraphdatabase.java:100) @ org.neo4j.graphdb.factory.graphdatabasefactory$1.newdatabase(graphdatabasefactory.java:92) @ org.neo4j.graphdb.factory.graphdatabasebuilder.newgraphdatabase(graphdatabasebuilder.java:19

gsp - Grails pagination not working -

i've been week trying fix pagination problem, no results, i have in controller patientcontroller{ def show(long id) { def patientinstance = patient.get(id) if (!patientinstance) { flash.message = message(code: 'default.not.found.message', args: [message(code: 'patient.label', default: 'patient'), id]) return } def historyinstance = history.findallbypatient(patientinstance) def total = historyinstance.size() [historyinstance: historyinstance,patientinstance: patientinstance,historyinstancetotal: total] } } and have code on view <g:each in="${historyinstance}" var="historyinstances" status="i"> ... </g:each> <div class="pagination"> <g:paginate total="${historyinstancetotal}"/> </div> i used params , max on <g:paginate> , tried no result shows whole set of history in view.

loops - Run jquery function after $.each has finished using promise -

i have each loop pulls foursquare info. looks similar following: $.getjson('https://api.foursquare.com/v2/venues/search?search_string_here', function(data) { $.each(data.response.venues, function(i,venues){ var content = foursquare stuff; $(content).appendto("#foursquare"); }); }); i need initiate function after each loop finished. works if placed after each loop: $( "#foursquare" ).promise().done(function() { //do stuff }); i not familiar promise - strange thing works selector. 2 questions: 1) best way of going each callback? 2) correct selector here? each isnt iterating on existing elements, unsure of 'promise' $.getjson return promise can use. called after callback. var $ajax = $.getjson('url', function(data){ // $.each }); $ajax.done(function(){ // stuff });

Force relaunch of an activity Android -

i have activity in app can opened notification. content of activity depends on kind of notification. example : if receive 'a notification', app launch activity , 1 displays 'a received'. then, if receive 'b notification', app launch activity again , displays 'b received'. probleme when activity has been launched once, when 'b notification' relaunch again, activity still displays 'a received'. how force activity re-create depending on intent received? i tried intent.setflags(intent.flag_activity_new_task | intent.flag_activity_clear_top); doesn't work. thanks ! edit : after research, i've found out pendingindent problem. seems intent passed parameter in pendingintent.getactivity(ctx, 0, intent, 0) wasn't updated. added intent.setaction(long.tostring(system.currenttimemillis())); and worked charm. finish existing activity in 'a' or 'b' notification handler before starting activity.

javascript - Chrome and oninput events -

i have textbox, , trying fire event oninput (my example below removes comma input, need more advance things). code works great on firefox , internet explorer, when click textbox in chrome, have .5 seconds start typing, otherwise loose focus. testing exact code below on website creates error. idea? <input type="text" id="question" name="question" oninput="clean(this);" /> <script type="text/javascript"> function clean(q){ q.value=q.value.replace(",",""); } </script> thanks help credit goes comfreek , robh pointing out works fine on js fiddle. feel quite dumb not trying first. turns out of other javascript on page causing trigger break. everyone's help!

javascript - Remove First Character and Add Values -

this question has answer here: how convert currency string double jquery or javascript? 13 answers i'm using autonumeric jquery plugin place dollar sign , decimal a couple of text fields. want add these 2 values, i'm getting nan error because of dollar sign placed in front of number. how remove dollar sign (first character), add values , place total value field? sample html <input type="text" id="value_one" /><br /> <input type="text" id="value_two" /><br /> <input type="text" id="total_value" /><br /> sample jquery $("body").hover(function() { var = +$('#value_one').val(); var b = +$('#value_two').val(); var total = a+b; $('#total_value').val(total); }); fiddle jquery $("#totalme")

ios - Is there a way to let the user chose whether or not trust the site when we try to use NSURLConnection to connect with SSL for an untrusted cert? -

there similar question on stack overflow. here code accept untrusted server certificate anyway. - (bool)connection:(nsurlconnection *)connection canauthenticateagainstprotectionspace:(nsurlprotectionspace *)space { //we can attempt authenticate... return yes; } - (void)connection:(nsurlconnection *)connection didreceiveauthenticationchallenge:(nsurlauthenticationchallenge *)challenge { if ([[challenge protectionspace] authenticationmethod] == nsurlauthenticationmethodservertrust) { [[challenge sender] usecredential:[nsurlcredential credentialfortrust:[[challenge protectionspace] servertrust]] forauthenticationchallenge:challenge]; } else { // other situation } } however, want present alter view let user chose whether or not trust site. uialertview *alert = [[uialertview alloc] initwithtitle: [[challenge protectionspace]host] message:@"do trust site?" delegate:self cancelbuttontitle:@"no" otherbuttontitles:@"yes&

android - Adding transparent rounded corners to google map -

so i'm designing app uses google aps api, , want map better rounding corners. found bunch of tutorials of them work if activity background solid color, example black. however, application has multi-color background. there way make corners rounded, transparent doesn't block background? well guess have stumbled on question asked regarding same topic: is there way implement rounded corners mapfragment? but in case needed solid color corners. don't see easy way perform ask for. there no way added rounded corners map "out of box" need cover corners other texture, typically 9-patch texture, stretch accordingly screen size. you can take @ blog post on 9-patchs wrote , maybe try create semi-transparent texture fit needs: 9-patch guide

iOS : AVFoundation Image Capture Dark -

i'm developping app captures photos ipad front camera. photos coming dark . have idea how fix issue, please ? here code , explainations : 1) initialize capture session -(void)viewdidappear:(bool)animated{ capturesession = [[avcapturesession alloc] init]; nsarray *devices = [avcapturedevice devices]; avcapturedevice *frontcamera; (avcapturedevice *device in devices){ if ([device position] == avcapturedevicepositionfront) { frontcamera = device; } } if ([frontcamera isexposuremodesupported:avcaptureexposuremodecontinuousautoexposure]){ nserror *error=nil; if ([frontcamera lockforconfiguration:&error]){ frontcamera.exposuremode = avcaptureexposuremodecontinuousautoexposure; frontcamera.focusmode=avcapturefocusmodeautofocus; [frontcamera unlockforconfiguration]; } } nserror *error = nil; avcapturedeviceinput *frontfacingcameradeviceinput = [avcapt

How to make a asp.net drop down list responsive -

i wondering how make asp.net drop down list responsive. , mean when on smart phone format width fit screen, , when on tablet same , on. any examples great. thanks help step 1: add 1 or more css classes you'll need start adding css class dropdown list control (hereafter referred ' the control '). can done adding 1 or more classes cssclass attribute in control. additionally should take @ conditional css statements. step 2: add usual responsive design styles class a basic responsive design style .responsivewidth{width:100%;max-width:950px;min-width:650px;} things remember... just remember when using max- , min-width, expected if use percent width , should use explicit width max-width , min-width . goes both ways, do: .reponsivewidth{width:900px;max-width:100%;} ...which keep control @ 900px width unless screen width drops below 900px. bonus info: here links have in "responsive design" folder in bookmarks... tips 7 res

java - how to remove or make invisible parent window using JDialog class -

i creating sudoku game , wondering if there way remove (or make invisible) parent window when create jdialog objects when user requests new sudoku board. when create new board using jdialog object (via inner classes dialog1 , dialog2) jdialog objects stacked on top of each other. specifically, in dialog2 class, want underlying window contains previous game disappear when "set givens" button pressed. i post separate classes if want visually observe problem describing, first class should relevant issue (sudokumain). edit never mind, apparently there limit characters can enter here. well, here sudokumain irrelevant sections of code removed: // allow short name access following classes import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; public class sudokumain extends jcomponent { /** * application method. * * @param args command-line arguments. */ public static void main(string[] args) { new sudokumain();

HTML Table 3 rows with 2 columns of equsl height -

having problem coming this: i have few asp.net controls (datalist), , main issue is, need display 3 rows 2 columns, row height same , should fill viewable port of page. i tried regular html table heights percentages, but, no go. if go fix height in px, ok, doesn't when viewable page height changes. any ideas on how best achieve (even if not using tables)? thanks. code: <form id="form1" runat="server"> <asp:scriptmanager id="scriptmanager1" runat="server"> </asp:scriptmanager> <asp:tabcontainer id="tabcontainer1" runat="server"> <asp:tabpanel id="tabpnlmoves" runat="server" cssclass="movespanelclass"> <headertemplate> moves </headertemplate> <contenttemplate> <div style="width: 25%; float: left; border: 1px solid black; height: 33%; display: table-cell;"> </div>

javascript - jquery click does not work -

anyone have idea why jquery click won't work? it's attached hyperlink. jquery(function ($) { $(".delete").click(function(e) { alert("hello"); }); var socket = io.connect(); var $messageform = $('#sendmessage'); var $messagetitle = $('#title'); var $messagebox = $('#message'); var $chat = $('#chat'); $messageform.click(function (e) { if ($.trim($("#title").val()).length === 0) { alert('you must provide valid input'); $messagetitle.val(''); $messagebox.val(''); return false; } if ($.trim($("#message").val()).length === 0) { alert('you must provide valid input'); $messagetitle.val(''); $messagebox.val(''); return false; } else { e.preventdefault(); socket.emit(

javascript - Looping within functions -

i'd repeat piece of code 2 second interval inbetween, how so? $(document).keydown(function(e) { kkeys.push( e.keycode ); if ( kkeys.tostring().indexof( konami ) >= 0 ) { $(document).unbind('keydown',arguments.callee); $('.preview').attr('style', 'background: #'+math.floor(math.random()*16777215).tostring(16) + ';'); } }); with being repeated: $('.preview').attr('style', 'background: #'+math.floor(math.random()*16777215).tostring(16) + ';'); you want use conjunction of settimeout() with recursive call function , proper base case. you can keep argument total time elapsed , use want. can use setinterval() that should put on right track

MySQL PHP query always returning 1 -

this script returns one, not actual number of online users. can fix code? $oq = "select user user_archive time > (now() - interval 5 minute)"; $oresult = mysqli_query($con,$oq); $online_users = mysqli_num_rows($oresult); if($online_users = 1) { echo "{$online_users} user online"; } if($online_users != 1) { echo "{$online_users} users online"; } you need use == instead of = if($online_users == 1) { echo "{$online_users} user online"; }

php - page slide for exposing left menu with twitter bootstrap -

i'm trying emulate or find plugin slides page on exposing navigation menu twitter bootstrap template : if resize page you'll see option in header row slide page over. i've looked through javascript code don't see how accomplished. i found git project pageslide slides entire page. any idea how bootstrap page slides menu out smaller resolution devices? it's page structure , css3 transforms/styles. <div id="wrap"> <div id="menu" role="navigation"></div> <div id="main" role="main"></div> </div> the page uses media queries set styles based on available screen real-estate , applying style js-menu html element: when open (abbreviated): @media screen , (max-width: 950px) .js-advanced.js-menu #wrap { -webkit-transform: translate3d(280px, 0, 0); } when closed (abbreviated): @media screen , (max-width: 950px) .js-advanced #wrap {

objective c - OCMock is not cleaning up stubbed class methods -

i'm trying use ocmock mock out internal class dependencies (e.g. class uses nsmutabledata , verifying against mock nsmutabledata). i'm mocking factory methods return mock objects. as far can tell mock objects not cleaning class method mocks, or cleaning them partially. having pretty adverse effects on unrelated tests may end invoking same class methods. a short example i've been able repro locally illustrate: id data1 = [nsmutabledata data]; // new instance id data2 = [nsmutabledata data]; // new instance // mock +data , have return data1 id mock = [ocmockobject mockforclass:[nsmutabledata class]]; [[[[mock stub] classmethod] andreturn:data1] data]; id foo = [nsmutabledata data]; // foo == data1 ok that's [mock stopmocking]; mock = nil; // using arc no explicit -release id bar = [nsmutabledata data]; // bar == data1, wait what? shouldn't new? i've found problem worse if mock +new. last line create bar blows either bad

how to get custom made object from ObjectMapper in java -

i doing following: ironrunid id = new ironrunid("runobject", "runid1", 4); objectmapper mapper = new objectmapper(); hashmap<string, object> map = new hashmap<string, object>(); map.put("runid", id); string json = mapper.writevalueasstring(map); objectmapper mapper = new objectmapper(); map<string, object> map1 = mapper.readvalue(json, new typereference<map<string, object>>() {}); ironrunid runid = (ironrunid) (map1.get("runid")); but gives me error: cannot cast java.util.linkedhashmap ironrunid why object returned map.get() of type linkedhashmap? on contrary, if do: list<object> mylist = new arraylist<object>(); mylist.add("jonh"); mylist.add("jack"); map.put("list", mylist); then object returned map.get() after doing mapper.readvalue of type arraylist. why difference? inserting default types map returns correct object. inserting custom made object in map no

r - Save plot with a given aspect ratio -

Image
i'm working awesome library ggplot2. figured out how set aspect ratio of plot using coord_fixed . now, i'd save plot pdf specified width (e.g 10 cm) , let required height calculated. did not figure out how achieve this. possible? you can use grid functions calculate full size of ggplot grob, there ( edit: @ least) 2 caveats: an device window open, unit conversion the plot panel size 0 default, meant calculated on-the-fly according device (viewport) lives in, not opposite. that being said, following function attempts open device fits ggplot exactly, library(ggplot2) library(grid) sizeit <- function(p, panel.size = 2, default.ar=1){ gb <- ggplot_build(p) # first check if theme sets aspect ratio ar <- gb$plot$coordinates$ratio # second possibility: aspect ratio set coordinates, results in # use of 'null' units gtable layout. let's find out g <- ggplot_gtable(gb) nullw <- sapply(g$widths, attr, "unit")

javascript - Testing starting chars of two sentences against eachother -

i'm working way through eloquent javascript , ran practice: write function called startswith takes 2 arguments, both strings. returns true when first argument starts characters in second argument, , false otherwise. here's answer gave: function startswith(string, pattern) { return string.slice(0, pattern.length) == pattern; } show(startswith("rotation", "rot")); but wanted more thorough program take start characters chars , test them in each sentence , spit out whether starting characters same in each sentence. i'm new javascript , programming, appreciated! here's thought work: var sentenceone = "pretty kitty doesn't you!"; var sentencetwo = "preachy cat loves you."; function startswith(chars) { return (sentenceone.slice(0, chars.length) == chars) == (sentencetwo.slice(0, chars.length) == chars); } show(startswith("pre")); the answer given pretty thorough. given 2 sentences do: var senten

html - PHP Send Script -- Checkbox verify -

url: http://medtransportcenter.com/medical-transportation/los-altos/ have updated form include checkbox. i'm trying send-form.php script recognize whether or not checkbox checked or not when sends confirmation email. did research , found following code trick checking whether checked. but, inserted , kept giving me syntax error when testing form. included additional code have php script , checkbox field below. please this. my whole form html: <div class="form-box"> <!-- form --> <form id="proform" action="send-form.php" method="post" > <h2 style="text-align:center;">request info</h2> <h3 style="text-align:center;">free expert advice</h3> <div class="form-content"> <!-- form --> <table cellpadding="0" cellspacing="0" border="0"> <!--tr> <td class="field-full" colspan="2">

c - Wireless tools: Converting network essid to char -

i need correcting code because prints out weird stuff. i used wireless tools , iwlib.h scan wireless networks , essids. when use: printf("network name %s:", result->b.essid); then works charm , prints name out me. however, want convert char can later send on buffer through network. (unless can send results , "name extraction" can happen on other side? or not possible?) see sample code below (not full code) of how attempt random characters result. wireless_scan_head head; wireless_scan *result; iwrange range; while(result != null) { char *network; network = result->b.essid; int k; int size = strnlen(result->b.essid); printf("\n network essid:"); for(k=0; k<=size; k++) { printf("%c", network[k]); k++; } result = result->next; } thanks help! just formalize things... you're incrementing k inside loop in declaration. outputting every other character

javascript - can you call a function while loading data in D3 js -

i trying figure out if there way can call function while loading data in d3.js. code below, not sure if on right track, seems simple cant work d3.json("country_data.json", mac.call(country_data)); function mac(e) { //i function perform operations. //the data in file country_data passed function } if had ideas on how can implement appreciate it, thanks. your code passing result of calling mac() should passing reference mac so... d3.json("country_data.json", mac); function mac(error, countrydata) { if (error) { // deal error } else { // perform operations on countrydata } } or declare callback anonymous function inline call d3.json: d3.json("country_data.json", function (error, countrydata) { if (error) { // deal error } else { // perform operations on countrydata } });

objective c - Transition between @try @catch -

i'm having hard time understanding transition @ try @ catch i understand if statement @try block throws exception, @catch block gets executed. don't understand how nsexception object containing information exception gets passed argument. lot of stuff i'm reading online exceptions skip detail. the example book @try { [myarray objectatindex: 2]; } @catch (nsexception *exception){ nslog(@"caught %@%@", exception.name, exception.reason); } so once exception detected exception object automatically created , sent @catch block? try , catch used exception handling. whenever error occurs in try block, compiler jumps corresponding catch block , passes exception object it. access exception object know details of error.

php - Apache htaccess rewriterule issue -

i have following rule in htaccess rewriterule ^noticias/?$ /index.php?view=pagination&ptype=noticias [l] but problem if put spaces in url, .. can access page normally. http://gamesite.org/noticias / i not know block it. without / browser removes spaces. problem need bar, because of paging on site. ex: /noticias/1/ here htaccess file http://pastebin.com/gwtzgagv

python - Reverse URL issue -

i have django model defined from utils.utils import apimodel django.db import models django.core.urlresolvers import reverse class djangojobposting(apimodel): title = models.charfield(max_length=50) description = models.textfield() company = models.charfield(max_length=25) def get_absolute_url(self): return reverse('jobs.views.jobdetail', args=[self.pk]) with view from restless.views import endpoint restless.models import serialize .models import * utils.utils import json404 import ujson json class joblist(endpoint): def get(self, request): fields = [ ('url', lambda job: job.get_absolute_url()), 'title', ('description',lambda job: job.description[:50]), 'id' ] jobs = djangojobposting.objects.all() return serialize(jobs, fields) class jobdetail(endpoint): def get(self, request, pk): try: job = djangojob

html - In CSS3 is "li:hover > a" and "li a:hover" the same -

is "li:hover > a" , "li a:hover" same such in codes ul#navigation li a:hover { background:#f8f8f8; color:#282828;} and ul#navigation li:hover > { background:#fff;} not @ all, 2 different selectors. li a:hover means: apply rules a element, descendant of li element, when user puts mouse on former. li:hover > means: apply rules a element, direct child of li element, when user puts mouse on latter. as can see, there several differences. first of all, first selector apply rules anchor, when anchor hovered; means if have anchor element smaller parent list item, have put mouse on anchor trigger changes. on other hand, second selector applies rule anchor, wherever mouse hovers on parent. the second rule sports > , known direct descendant selector or child selector apply rules if a tag directly contained within li no intermediate containers.

node.js - Selenium Webdriver requires restarts to function consistently -

my testing stack consists of latest version of selenium server (2.33.0, aka selenium-server-standalone-2.33.0.jar), mocha, node.js, , phantomjs. my question regards following code: var webdriver = require('../../../lib/selenium/node_modules/selenium-webdriver/'), driver = new webdriver.builder(). withcapabilities({'browsername': 'phantomjs'}). build(); driver.manage().timeouts().implicitlywait(15000); describe('wordpress', function() { it('should able log in', function(done) { driver.get('http://#### redacted ####/wp-login.php'); driver.findelement(webdriver.by.css('#user_login')).sendkeys('#### redacted ####'); driver.findelement(webdriver.by.css('#user_pass')).sendkeys('#### redacted ####'); driver.findelement(webdriver.by.css('#wp-submit')).click(); // #wpwrap element on wordpress dashboard displayed once