Posts

Python selenium error when trying to launch firefox -

i getting error when trying open firefox using selenium in ipython notebook. i've looked around , have found similar errors nothing matches error i'm getting. know problem might , how fix it? i'm using firefox 22. the code typed in follows: from selenium import webdriver driver = webdriver.firefox() the error code returns follows: windowserror traceback (most recent call last) <ipython-input-7-fd567e24185f> in <module>() ----> 1 driver = webdriver.firefox() c:\anaconda\lib\site-packages\selenium\webdriver\firefox\webdriver.pyc in __init__(self, firefox_profile, firefox_binary, timeout, capabilities, proxy) 56 remotewebdriver.__init__(self, 57 command_executor=extensionconnection("127.0.0.1", self.profile, ---> 58 self.binary, timeout), 59 desired_capabilities=capabilities) 60 self._is_remote = false c:\anaconda\lib\site-packages\...

ruby - NameError: uninitialized constant when trying to execute rails tests -

in rails 3.2.13 app i'm writing right have model called business . model getting fatter , fatter, decided split in two, extracting code related availability rails concern named availability , stored @ models/concerns/business class business module availability extend activesupport::concern availability_open = 1 availability_closed = -1 availability_complete = -2 ... as concerns not enabled in rails default, i've put following line in config/application.rb in order autoload them: config.autoload_paths += %w(#{config.root}/app/models/concerns) the problem that, after split, tests have stopped working, returning nameerror: uninitialized constant availability error. suppose need require concern somehow in tests, haven't managed yet, , don't understand why concern needed in tests doesn't make use of it. the following stack trace returned after running tests: nameerror: uninitialized constant availability (erb):9:i...

java - Webservices invocation exception -- where am I going wrong I have this class in classpath -

this webservice. service working fine through java application when make jar , run web project getting exception "severe: exception occurred during processing request: null java.lang.reflect.invocationtargetexception" , @ end caused by: java.lang.noclassdeffounderror: com/oracle/ccpayment

android - Image for item menu action bar sherlock -

Image
i adding 2 images in menu action bar sherlock. image2 big normal size. image appear correctly in device: for recent device (like s4) have problem image appear small. doesn't ok. i using action bar sherlock library if have large number of images displayed app, creating different versions mdpi, hdpi etc may take space , create unacceptable maintenance overhead you. in case suggest resize images dynamically. use following code resize 320 x 200 png , jpg images tablets , fine ... // method display image (tablets only) ... private void display_image(string imagename){ if (istablet(getactivity())){ // tablets debuglog( "display tablet image="+imagename); int resid = getresources().getidentifier(imagename,"drawable", getactivity().getpackagename()); // corresponding resource id if (resid != 0) { bitmap bmp=bitmapfactory.decoderesource(getresources(), resid); ...

Why might Google Fusion Tables sqlGet queries stop working after Google+ sign-in through gapi.auth? -

i'm writing page uses oauth 2.0 via gapi.auth.authorize authenticate google+ user , gapi.client.request run google fusion tables sqlget queries. find queries run fine before authentication, fail 403 "insufficient permission" error when run more 30 seconds after authentication. the problem demonstrated page: https://googledrive.com/host/0b5urq1jzb1myswlou3nty2m4qnc/test3b.htm please follow these steps: click "query" run gapi.client.request google fusion table sql-get query returning count of rows. run until oauth used in steps 2 , 3. click "start oauth" run immediate:true authorization against google+. if signed google+, user name , id displayed in third button. if google+ user name not displayed in third button, click button ("authorize") , sign google+. click "query" button again. query run without error when pressed within 30 seconds of oauth authorization. after that, query fails 403 error. why? here source dem...

Widgets inside Dojo dgrid OnDemandList -

i'm trying similar this question using ondemandlist instead of ondemandgrid. here have far define([ "dojo/_base/declare", "dijit/_widgetbase", "dijit/_templatedmixin", "dijit/_widgetsintemplatemixin", "dgrid/ondemandlist", "widget/categoryitem", "dojo/dom-construct", "dojo/text!./templates/category-list.html" ], function(declare, _widget, _templatedmixin, _widgetsintemplatemixin, ondemandlist, categoryitem, domconstruct, template) { var catlist = declare([ondemandlist]); return declare([_widget, _templatedmixin, _widgetsintemplatemixin], { templatestring: template, baseclass: "category-list", postcreate: function() { this.inherited(arguments); // create ondemandlist, place in div defined in template. var cat1 = this.cat1 = new catlist({ store: this.store, ...

linux - Problems running terminal command via Python -

i'm working on small project need control console player via python. example command works on linux terminal: mplayer -loop 0 -playlist <(find "/mnt/music/soundtrack" -type f | egrep -i '(\.mp3|\.wav|\.flac|\.ogg|\.avi|\.flv|\.mpeg|\.mpg)'| sort) in python i'm doing following: command = """mplayer -loop 0 -playlist <(find "/mnt/music/soundtrack" -type f | egrep -i '(\.mp3|\.wav|\.flac|\.ogg|\.avi|\.flv|\.mpeg|\.mpg)'| sort)""" os.system(command) the problem when try using python gives me error when run it: sh: 1: syntax error: "(" unexpected i'm confused here because exact same string. why doesn't second method work? thanks. your default user shell bash . python's os.system command calls sh default in linux. a workaround use subprocess.check_call() , pass shell=true argument tell subprocess execute using default user shell. import subprocess command...