Posts

c# - Can I instantiate a type as 'dynamic' from another AppDomain? -

i'm trying load type different assembly (not known @ build time) 'dynamic' , execute method on type. goal disconnect 'plugin' parent application such there no requirement shared code or common interface type. interface implied way of expected method signature on loaded type. this works: dynamic myobj = assembly.load("myassembly").createinstance("mytype"); myobj.execute(); however load type current appdomain along dependent assemblies. want modify allow me same thing in separate appdomain. this works doesn't make use of dynamic keyword, need know explicit type instantiating able call execute method: var appdomain = appdomain.createdomain(domainname, evidence, setup); var myobj = appdomain.createinstanceandunwrap(assembly, type); typeof(imyinterface).invokemember("execute", bindingflags.invokemethod, null, myobj); this target case , have been trying working: dynamic myobj = ad.createinstanceandunwrap(assembly, type)...

lotus notes - NullPointerException in Java script library -

i making first step java- trying create simple java script library in domino designer 8.5.2 perform sftp file transfers using jsch 0.1.48. library called lotusscript agent via ls2j. here sftp class script library, based on this answer : import com.jcraft.jsch.*; public class sftp { public string getfile(string host, string user, string pass, string localpath, string remotepath) { jsch jsch = new jsch(); session session = null; try { session = jsch.getsession(user, host, 22); session.setconfig("stricthostkeychecking", "no"); session.setpassword(pass); session.connect(); channel channel = session.openchannel("sftp"); channel.connect(); channelsftp sftpchannel = (channelsftp) channel; sftpchannel.get(remotepath, localpath); sftpchannel.exit(); session.disconnect(); } catch...

Android onResume from Application -

my client wants app show "warning" screen when application starts or when awakens sleep. i've tried creating onresume() event in master activity (which every other activity inherits from), causes endless loop: activity called, onresume() fired warning screen fires, causing calling activity paused user clicks ok accept message, returning user prior screen activity woken up go 1 even if around endless loop, warning screen fire whenever new activity loads. call bad thing. is there way mimic onresume() event @ application level rather @ activity level, can avoid these scenarios still have warning pop on application wake? why not use sharedpreferences. http://android-er.blogspot.com/2011/01/example-of-using-sharedpreferencesedito.html store time popup brought up, , if within 5 mins, or something, don't pop up. this break loop , not annoy user.

ninject - Error when disposing a IActivationBlock and importing IKernel -

the problem started when trying use solution below use ninject 3 mvc 4 rc web api project: http://www.peterprovost.org/blog/2012/06/19/adding-ninject-to-web-api/ this solution uses iactivationblock (created beginblock method ikernel) implement scope of calls. regular ninject project, seems work fine, when project uses extension ninject.extensions.interception.dynamicproxy, following exception occurs when dispose method of activation block called: error loading ninject component iadviceregistry no such component has been registered in kernel's component container. and, in next time when new activationblock created , resolve method called, following exception occurs: error loading ninject component icache no such component has been registered in kernel's component container. it seems problem not directly related mvc update, incompatibility between dynamicproxy , iactivationblock. edit: the source of problem when 1 of types requires ikernel ...

iphone - How to add tokens inline within a UITextView -

i add tokens or buttons inline in uitextview. thinking of trying embed nstokenfields inside uitextview? don't know if optimal way go it. appreciation sort of direction on how accomplish this. lot. nstokenfield doesn't exist on ios. take @ https://github.com/jasarien/jstokenfield -- it's not perfect, it's fair simulation.

Am I dreaming or do carriage returns prevent PHP versions from seeing a code line? -

i discovered code lines "cr" instead of "crlf" or "lf" @ end of line causing php behave weirdly, namely seeing 2 lines one, ignoring cr or, more accurately, interpreting is: carriage return not linefeed. i had never had problem before but, lately, discovered notepad++ put cr when hit "enter" move new line... causes script behave badly. for example, hello world script works fine when lines eneded lf or crlf crashes crs (at least replicate problem on both peer1 , hostgator servers -- else have different experience?)... <?php header( "http/1.1 301 moved permanently" ); header( "location: http://www.cnn.com/" ); ?> and error: fatal error: call undefined function phpheader() in /home/bernatch/public_html/test-redir-cr.php on line 1 obviously, php seeing <?php code , header function being on same line... my question is: a) there way force php interpret single cr different line or b) there way force no...

ios - How to create an ipa and run application in iPhone -

i have new macbook air. have created 1 test application. want create ipa file application. archive button in product menu not enable. how create ipa this? , thing want run application in iphone instead of simulator. how can so?? please help. thanks in advance. to make .ipa file read creating .ipa file . you need have apple's developer account, cost 99$. able make certificates , use them check app on mobile. how make certificates, read here this alot ....