Posts

c# - WCF - Setting Policy for UsernameToken -

i received updated wsdl service i'm consuming has below policy added <wsp:policy wssutil:id="usernametoken"> <ns0:supportingtokens xmlns:ns0="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512"> <wsp:policy> <ns0:usernametoken ns0:includetoken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200512/includetoken/alwaystorecipient"> <wsp:policy> <ns0:wssusernametoken10 /> </wsp:policy> </ns0:usernametoken> </wsp:policy> </ns0:supportingtokens> </wsp:policy> i have updated reference right clicking service reference --> configure service option inside visual studio. generated custombinding replacing previous basichttpbinding <custombinding> <binding name="mybindingname"> <!-- wsdlimporter encountered unrecognized policy assertions in servicedescription 'http://ouaf.oracle.com/webservices/c...

java - Array Tester - Beginner -

i long time lurker , first time user of overflow, able guide me in right direction. there more issues program i'd admit, however, i'm getting there! main concerns @ moment below... my first question looping program beginning. example, if user inputs integer < 1 program outputs error message. program stops there. how can loop prompt user input integer. i having issue when program prompts user "enter list of () integers:" reason, have enter more integers should have to. in end, program takes appropriate number, pretty weird. (see program test - notice 1 through 5 integer 6 below that. hit enter after 5 program doesn't continue. continues when hit enter, type 6 , hit enter again. array below accurate though.) let me know if should change else. hopefully able post updated code when figured out! in advance if have read point! /** * n irwin - programming - lab 23 * array tester - 4/21/2016 */ import java.util.scanner; public class a...

Are there known issues with Android Services on 4.1.x (Jelly Bean)? -

my question shot in dark: deal android 4.x / jelly bean? there known problems services, stickiness, foreground, etc.? backstory : tested music player application on sorts of android devices , emulators , on physical jelly bean device (samsung rugby pro). found mediaplayer oncompletion function not being fired consistently when screen turned off. isn't fired several minutes . when screen on, whether or not activity shown, application works fine. (there no problems on gingerbread, kitkat, lollipop, or marshmallow. have physical devices versions , work flawlessly.) device information: os version: 3.0.31-656355 release: 4.1.1 device: comancheatt model: samsung-sgh-i547 product: comancheuc brand: samsung display: jro03l.i547ucbll1 cpu_abi: armeabi-v7a cpu_abi2: armeabi hardware: qcom id: jro03l manufacturer: samsung user: se.infra host: sep-125 i figured out; hope helps ... the problem not in firing oncompletion event rather reset() blocks in...

Unable to build react-native app on Android device :failed to find target with hash string 'android-23' -

here full error: failed find target hash string 'android-23' in: /users/username/library/android/sdk this build.gradle file in android/app : android { compilesdkversion 23 buildtoolsversion "23.0.1" defaultconfig { applicationid "com.mobile" minsdkversion 16 targetsdkversion 22 versioncode 1 versionname "1.0" ndk { abifilters "armeabi-v7a", "x86" } } i ran android sdk manager, , have android sdk build-tools rev 23.0.1 installed, along files android 6.0 (api 23). i searched online problem , have tried many solutions; restarting terminal, deleting gradle file in root directory, making sure android_home points correct directory (as following reactnative docs, have copied in both ~./bashrc , ~./bash_profile following line: # if installed sdk via homebrew, otherwise ~/library/android/sdk export android_home=/usr/local/opt/android-sdk...

java - Load any libraries form any location after export -

is possible load additional libraries after jar has been created? want search folder jar-files, , load them libraries. "they" extend class, have, can adress them. folder, of libs not same folder, jar-file, loads others located. if there no other way, change settingsfile(where libraries-to-be-loaded linked) withinin jar itself, not great helpful, too;) thanks simon yes is. have use urlclassloader. urlclassloader loader = new urlclassloader(new url[]{new url("jar:file:/home/myapp/plugins/dateplugin.jar!/")}, classloader.getsystemclassloader()); myinterface pluginclass = (myinterface )loader.loadclass("com.mypackage.myclass").newinstance(); urlclassloader java doc you want make sure connect classloader main 1 passing system classloader constructor. allow assign newly loaded library existing interface. how can make plugin system game or application. here link source code showing in action: git hub repository sticky . @ class sticky.gui...

c# - DynamicObject. How execute function through TryInvoke? -

i want execute static functions through dynamicobject, don't know how execute saveoperation without specifying class name typeof(test1) or typeof(test2) . how relise better? for example class dynobj : dynamicobject { getmemberbinder saveoperation; public override bool trygetmember(getmemberbinder binder, out object result) { saveoperation = binder; result = this; return true; } public override bool tryinvoke(invokebinder binder, object[] args, out object result) { type mytype = typeof(test1 or test2 or ....); result = mytype.getmethod(saveoperation.name).invoke(null, args); return true; } } class program { static void main(string[] args) { dynamic d1 = new dynobj(); d1.func1(3,6); d1.func2(3,6); } } class test1 { public static void func1(int a, int b){...} } class test2 { public static void func2(int a, int b){ ....

Python 2.7: Dynamic module import in an imported module based on given variable -

there given 2 versions of storage. based on version, need select proper interface module result. the file structure looks this: lib/ __init__.py provider.py connection.py device.py storage/ __init__.py interface_v1.py # interface storage of version 1 interface_v2.py # interface storage of version 2 main.py the main.py imports provider.py , should import 1 of interfaces listed in storage subpackage depending on version of storage. main.py: from lib.provider import provider lib.connection import connection lib.device import device connection = connection.establish(device) storage_version = device.get_storage_version() massage = provider.get_data(connection) provider.py should import interface storage based on storage_version , implement provide functions: from storage import interface class provider(object): def __init_(self): self.storage = interface.storage def get_data(self, connection): ...