Posts

Showing posts from April, 2015

Testing location-based Android apps via AVD devices

Enable telnet on Windows 8: http://www.sysprobs.com/install-and-enable-telnet-in-windows-8-use-as-telnet-client Setting gps location of AVD devices: http://stackoverflow.com/questions/2279647/how-to-emulate-gps-location-in-the-android-emulator Installing external apk: http://stackoverflow.com/questions/17167636/how-to-install-a-apk-on-emulator-in-android-studio. For Android studio, the path to adb is C:\Users\ \AppData\Local\Android\sdk\platform-tools\adb.  An alternative is to use genymotion. You can set the GPS location conveniently through its UI. APK install is as simple as dragging the apk file from your local computer to

Calling PL/SQL functions with boolean output in cx_Oracle

PL/SQL functions with boolean output can't be called through the cursor.callfunc() method in cx_Oracle library. To overcome that, one needs to make use of a PL/SQL block. Here the PL/SQL function that returns a boolean has the following function prototype. FUNCTION is_correct RETURN BOOLEAN The python script using cx_Oracle sel = """ begin   if (is_correct())   then dbms_output.put_line('Yes');   else dbms_output.put_line('No');   end if; end; cursor.callproc("dbms_output.enable") cursor.execute(sel) statusVar = cursor.var(cx_Oracle.NUMBER) lineVar = cursor.var(cx_Oracle.STRING) cursor.callproc("dbms_output.get_line", (lineVar, statusVar)) if statusVar.getvalue() == 0:   sr = lineVar.getvalue()   print sr Reference