Posts

python - Force selenium to use the portable firefox application -

i have installed firefox 14 , has firefox portable version 25.0.1 on machine, run tests web site. due limitation in site i'm testing, cannot run tests on firefox 14 installation. cannot upgrade firefox 14 installation. so i'm looking solution can use portable firefox version instead of installed firefox 14 version. how should force selenium use portable version , not installed version? if direct me descriptive article/blog great. my code goes like:- * variables * ${selenium_hub} remote_url=http://127.0.0.1:4444/wd/hub ${browser} firefox d:\\firefox portable\\firefoxportable\\firefox.exe ${client_url} https://abcd.aline.local open browser ${client_url} ${browser} ${selenium_hub} specifying path as, d:/firefox portable/firefoxportable/firefox.exe not work because '/' get's removed. thoughts? ps: python used language you can specify path firefox binary want firefoxbinary class passed firefox_binary parameter when in...

c - Where do i put CFLAGS in this makefile? Need the -g so i can use gdb debugger -

i'm not used style of makefile teacher created 1 of our homeworks because doesn't have gcc command in it. here makefile. need know put -g cflag. ### architecture choice #uncomment 64-bit library = libmtron.a #uncomment 32-bit #library = libmtron32.a ### file lists bins = simulate objs = driver.o ### phony targets all/clean .phony: clean all: $(bins) clean: $(rm) $(bins) $(objs) ### build rules # sure link in library $(bins): $(objs) $(library) # update if header file changed driver.o: driver.h mtron.h simulate: mtron.h thanks help! this makefile utilizing make's built-in set of rules create objects , link executables, rather having type them in yourself. make has default rule looks (more or less) this: %.o : %.c $(cc) $(cppflags) $(cflags) -c -o $@ $< if don't specify rule build .o , make needs build 1 , has .c , use default built-in rule. so,...

Select MongoDB documents where a field either does not exist, is null, or is false? -

suppose have collection contains following documents: { "_id": 1, name: "apple" } { "_id": 2, name: "banana", "is_reported": null } { "_id": 3, name: "cherry", "is_reported": false } { "_id": 4, name: "kiwi", "is_reported": true } is there simpler query select documents "is_reported" in falsy state; is, either non-existent, null, or false? is, query selects apple, banana, , cherry, not kiwi? according mongodb faq , { "is_reported": null } select documents "is_reported" either null or nonexistent, still doesn't select documents "is_reported" false. right have following query, works fine, doesn't seem elegant. if there multiple fields need select on, gets messy fast. there better query achieves same end result? db.fruits.find({ $or: [ { "is_reported": null }, { "is_reported": false } ] }) ...

class - C++: How to create a collection of classes at startup -

i'm using c++ 11. have n source files each containing class inherits common base class. @ startup, want each class register collection. registration include 1) data necessary identifying purpose of class, 2) class factory creating instances of class. number of source files unknown. pattern doing this? solution needs cross-platform compatible visual studio 2013, gcc , others. first things first: keep in mind possible if classes derived single base class, because can store 1 type of object per vector instance. and when comes solution... can declare object in corresponding *.cpp file (mark extern in *.h file): // someclass.h // <-- class declaration goes here extern someclass someobj; // someclass.cpp someclass someobj; and add vector inside constructor: someclass(){ myvector.push_back(*this); } note myvector needs visible in scope. your myvector should populated after include someclass.h file 1 instance of someclass . note if populating done in ba...

java - Debugging UI and pause when a key is pressed -

i'm no debugging expert , lately came across problem has easy solution. when test , debug mathematica plugin idea , write code, build , run in sandbox idea. for not familiar writing plugins idea: main problem is, ui code there because comes idea. plugin implements specific interfaces required make idea understand mathematica language. therefore, setting breakpoint or throwing in onclicklistener suggested @jeroen not possible, because virtually haven't written single line of ui code*. now had situation works fine, when cancel specific action, weird happens. have no idea specific method (it none of mine!) called @ moment when press esc cancel action. current point deep inside sources of idea have , can navigate debugger!. question: easiest way in java make debugger break, wherever might when press esc in ui-program debug? *this not entirely true, sake of general solution think of way. as discussed in this question , can create own subclass of eventqueue ...

java - Android & Bluetooth & Arduino -

i trying display sensor data on android phone (target 4.3) received transmitting arduino type device. transmission takes place via bluetooth. able connect arduino type device , share data, reason having synchronization issues. the way arduino setup right now, after successful connection waits byte received phone (unsigned byte value 255), when receives byte responds sending packet (3 bytes) containing information 3 different sensors i.e. packet: byte 1: temperature data byte 2: cadence data byte 3: speed data all have display data(which updating live) repeatedly until user terminates connection on android phone. here code feel making minor error somewhere in logic. messagehandler handler mhandler = new handler(){ public void handlemessage(message msg){ super.handlemessage(msg); switch(msg.what){ case success_connect: // something; connectedthread co...

android - Adjusting to different screen sizes not working? -

i thought successful in adjusting different screen sizes(i using eclipse emulators , creating different screen sizes test app) when test app on actual devices result of app varies. example large screen size set emulator nexus s , work , fine, try on alcatel 1 touch fierce(real device) still considered large screen size app play little bit off, play on device considered large screen size app play emulator. guess mt question why? samble of how i'm checking different screen sizes below: displaymetrics displaymetrics = new displaymetrics(); getwindowmanager().getdefaultdisplay().getmetrics(displaymetrics); switch(displaymetrics.densitydpi) { case displaymetrics.density_low: // layout small sized devices. break; case displaymetrics.density_medium: // layout medium-sized devices. break; case displaymetrics.density_high: // layout large devices. break; case displaymetrics.de...