Search Results

Search found 523 results on 21 pages for 'invocation'.

Page 2/21 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Process.Start concatenating cmd line from previous invocation

    - by Ralph
    Hi, I am using a Process.Start in .Net 2.0 to start a child win32 app. Process.start ( "SomeProcess.exe", "<Cmd line>" ); The process runs fine but and the user then closes this window. However if I then run the same process again in the same session, the cmd line recieved by the called process is now a concatentation of the previous call. I.e SomeProcess.exe recieves the cmd line " SomeProcess.exe ". Has anyone else seen this behaviour before? Any help much appreciated. Ralph.

    Read the article

  • Toggle Android emulator network traffic from emulator invocation

    - by highphi
    I'm working on scripts to manage large amounts of Android emulators and I need to disable all network traffic on some of them. Because I'm doing all of this on a headless server, I cannot use the F8 hotkey described on the emulater documentation. I'm currently routing the TCP traffic through a null proxy with by using emulator-arm ... -http-proxy 0.0.0.0:0 and this blocks the traffic that I want it to. I thought this was working well until I noticed some strange error messages while running my scripts. The console started outputting accept too many open files and checking the open files with lsof reveals numerous messages stating "can't identify protocol" ... emulator- 19463 username 19u sock 0,6 0t0 1976595845 can't identify protocol emulator- 19463 username 20u sock 0,6 0t0 1976595847 can't identify protocol ... The only "solution" I found to this is to kill all of the emulators and then wait until this limit is reached again, which is hardly a solution at all. Is there another way to do this while invoking the emulator? Am I incorrectly using the -htt-proxy switch to block the traffic? Other people found solutions to block traffic by manually doing this by using airplane mode, but this isn't feasible for me as I'm controlling emulators via scripts. I could send keyevents to the emulator with my script and turn the phone on in airplane mode, but I would prefer something more reliable than this.

    Read the article

  • Handler invocation speed: Objective-C vs virtual functions

    - by Kerido
    I heard that calling a handler (delegate, etc.) in Objective-C can be even faster than calling a virtual function in C++. Is it really correct? If so, how can that be? AFAIK, virtual functions are not that slow to call. At least, this is my understanding of what happens when a virtual function is called: Compute the index of the function pointer location in vtbl. Obtain the pointer to vtbl. Dereference the pointer and obtain the beginning of the array of function pointers. Offset (in pointer scale) the beginning of the array with the index value obtained on step 1. Issue a call instruction. Unfortunately, I don't know Objective-C so it's hard for me to compare performance. But at least, the mechanism of a virtual function call doesn't look that slow, right? How can something other than static function call be faster?

    Read the article

  • Autotools automatic invocation of lcov after 'make check'

    - by disown
    I have successfully set up an autotools project where the tests compiles with instrumentation so I can get a test coverage report. I can get the report by running lcov in the source dir after a successful 'make check'. I now face the problem that I want to automate this step. I would like to add this to 'make check' or to make it a separate goal 'make check-coverage'. Ideally I would like to parse the result and fail if the coverage falls below a certain percentage. Problem is that I cannot figure out how to add a custom target at all. The closest I got was finding this example autotools config, but I can't see where in that project the goal 'make lcov' is added. I can only see some configure flags in m4/auxdevel.m4. Any tips?

    Read the article

  • Just-in-time invocation of Facebook login window from UIWebView

    - by Chris Garrett
    I have an app that presents a UIWebView pointing to my own server. I have a Facebook Like button on some pages inside the UIWebView. I have it working now, but the login screen is way too big for the phone screen. I would like to present a nicer login dialog such as the one in the Facebook iPhone API, and then continue back to the web view. The Facebook iPhone SDK has support for a login button and iPhone-friendly login screen, but it assumes that a user will click a login button before doing anything Facebook related. I would like the Like button to just appear, and to bring up the iPhone login screen only when necessary. I have monitored HTTP requests from my web view, and it looks like I could intercept the login request there, and present the login dialog. However, it seems that this would be fragile, because if Facebook changes those calls then my app will no longer work. Is there a more elegant way to do this?

    Read the article

  • Apache mod php and script invocation

    - by Abhi
    Say I am running a PHP script, foo.php, inside apache configured with mod php, then, say I invoke the script from my browser(or any other means), does apache spawn off a new process in which the script gets executed? How does it work? Can someone pls point me to some good article on this?

    Read the article

  • client-side synchronous service invocation

    - by qkrsppopcmpt
    I am talking about synchronous on the client side. That means, the service requester is blocking after sending a message to the service. my question is: is it related to the -a -s parameter of wsdl2java tool, Since -a generate async style code and -s generate sync style code. Or the client side blocking or not is totally controlled by the client logic? Thanks

    Read the article

  • Formatted HTML as output from method invocation from JMX HTTP page

    - by Dutch
    Hi, Is there a way to return HTML from a method which gets called from the JMX HTTP page. I have a huge set of data and want to display the data with some formatting. The following code does not work: @ManagedOperation(description = "return html") @ManagedOperationParameters({@ManagedOperationParameter(name = "someVal", description = "text")}) public List returnAsHtml(String someVal) { return ""+someValblah"; } Looks like JMX escapes the returned script before throwing it to the browser.

    Read the article

  • Invocation of ViewDidLoad after initWithNibName

    - by live2dream95
    It appears that ViewDidLoad() is sent to a ViewController only after its View is physically displayed (i.e. via NavigationController pushViewController), and not immediately after initWithNibName(). Is this a behavior I can rely on? I would like to get the chance to set the member variables of my view so that all the members are valid by the time ViewDidLoad() is invoked.

    Read the article

  • Javascript debugging: stopping/breaking at every javascript invocation

    - by portoalet
    I am dealing with a complex legacy javascript code base, and it's difficult to figure out where to put breakpoint (I have to find the files, put a breakpoint in firebug etc). Is there a way so that Firebug breaks on the first javascript execution that it encounters every time? In other words, every time I click on something on the page, and if a javascript code is executed, I want Firebug to break on that line? Of course I don't want Firebug to stop when it executes it's internal javascript. Is this possible?

    Read the article

  • Javascript new object (function ) vs inline invocation

    - by Sheldon Ross
    Is there any considerations to determine which is better practice for creating an object with private members? var object = new function () { var private = "private variable"; return { method : function () { ..dosomething with private; } } } VS var object = function () { ... }(); Basically what is the difference between using NEW here, and just invoking the function immediately after we define it?

    Read the article

  • PHP: prevent invocation of method X from from context != Y

    - by sunwukung
    This is a tricky one. I am "emulating" ZF Bootstrapping (surface appearance). Don't ask me why, call it academic interest. So I have a Bootstrap Abstract with a method "run" that iterates over itself to locate any methods prefixed with "init". The application looks for a user defined class which extends this class, in which the user can define any number of methods in this way. However, I want to prevent the user from being able to execute the "run" command of it's parent class, while still exposing the same command for the client code. Anyone got any thoughts/advice/guidance? regards SWK

    Read the article

  • JSF 2.0 method invocation with argument from var of dataGrid

    - by little_b
    Hello I use primefaces with facelets and i have a quastion: for example i have dataGrid and i want to call method of bean, that registered in faces-config, to include some dynamic content: <p:dataGrid var="provider" value="#{paymentFormBean.providers}"> <ui:include src="contentFactory.getSpecificForm('some attribute')"/> </p:dataGrid> How could i invoke getSpecificForm method with argument from var of dataGrid? Something like: <p:dataGrid var="provider" value="#{paymentFormBean.providers}"> <ui:include src="contentFactory.getSpecificForm(provider.formName)"/> </p:dataGrid> Could anyone help me? Thank you

    Read the article

  • C# generics method invocation

    - by Firat KÜÇÜK
    Hi, i have some polymorphic methods and i want to call via using an intermediate method. Following class is the simplified version of my program. class Program { public class A { } public class B { } public class C { } public void SomeMethod(A value) { Console.WriteLine("A value"); } public void SomeMethod(B value) { Console.WriteLine("B value"); } public void SomeMethod(C value) { Console.WriteLine("C value"); } static void Main(string[] args) { Program p = new Program(); // code block p.IntermediateMethod<A>(new A()); p.IntermediateMethod<B>(new B()); p.IntermediateMethod<C>(new C()); } public void IntermediateMethod<T>(T value) { // code block SomeMethod(value); // code block } }

    Read the article

  • Constructor invocation returned null: what to do?

    - by strager
    I have code which looks like: private static DirectiveNode CreateInstance(Type nodeType, DirectiveInfo info) { var ctor = nodeType.GetConstructor(new[] { typeof(DirectiveInfo) }); if(ctor == null) { throw new MissingMethodException(nodeType.FullName, "ctor"); } var node = ctor.Invoke(new[] { info }) as DirectiveNode; if(node == null) { // ???; } return node; } I am looking for what to do (e.g. what type of exception to throw) when the Invoke method returns something which isn't a DirectiveNode or when it returns null (indicated by // ??? above). (By the method's contract, nodeType will always describe a subclass of DirectiveNode.) I am not sure when calling a constructor would return null, so I am not sure if I should handle anything at all, but I still want to be on the safe side and throw an exception if something goes wrong.

    Read the article

  • Creating java executable using JNI ?

    - by Xinus
    I am trying to create executable under windows platform for Java program using JNI ,C/C++ and invocation API, I have already created jar file for my program which includes all dependencies. I want to embed it in exe file, I was successful in running simple main class(present in file system) using JNI invocation API, I am planning to add jar file as resource in C/C++ program. But I don't know how do I run that jar file , One option is create temporary jar file on file system and run it using java, But I do not want to expose my jar file to everyone for security reasons, How can I run serialized jar file on the fly using JNI ?

    Read the article

  • Python interpreter invocation with "-c" and indentation issues

    - by alexander
    I'm trying to invoke Python using the "-c" argument to allow me to run some arbitrary python code easily, like this: python.exe -c "for idx in range(10): print idx" Now this code works fine, from within my batch file, however, I'm running into problems when I want to do anything more than this. Consider the following Python code: foo = 'bar' for idx in range(10): print idx this would then give you 0-9 on the stdout. However, if I collapse this into a single line, using semicolons as delimiters, to get the following: foo = 'bar';for idx in range(10): print idx and try to run it using python.exe -c it get a SyntaxError raised: C:\Python>python.exe -c "foo = 'bar';for idx in range(10): print idx" File "<string>", line 1 foo = 'bar';for idx in range(10): print idx ^ SyntaxError: invalid syntax Anyone know how I can actually use this without switching to a separate .py file?

    Read the article

  • Disallow private constructor invocation in friend function

    - by user2907032
    Is there any way to not allow private construction in friend function, In case we do have private constructor with friend function in our class. Only Static method should be responsible for object creation and other than this compiler should flash error message #include <iostream> #include <memory> using namespace std; class a { public: void see () { cout<<"Motimaa"; } static a& getinstance() { static a instance; return instance; } private: a() {}; friend void access(); }; void access () { a obj; obj.see();//still friend function can access } int main() { a::getinstance().see(); access(); return 1; }

    Read the article

  • How to conditionalize GUI tests using Netbeans/Maven vs maven on command line invocation

    - by Ilane
    I'd like to have a single project pom but have my GUI tests always run when I'm invoking JUnit on Netbeans, but have them conditional (on an environment variable?) when building on the command line (usually for production build - on a headless machine, but sometimes just for build speed). I don't mind instrumenting my JUnit tests for this, as I already have to set up my GUI test infrastructure, but how do I conditionalize my pom! Netbeans 6.5 with Maven plugin. Any ideas how I can accomplish this? Ilane

    Read the article

  • Strange C++ thread function invocation

    - by Tony
    I have the following: class DThread { virtual void run()=0; _beginthreadex(NULL,0,tfunc,this,0,&m_UIThreadID); // class itself being passed as param to thread function... static unsigned int __stdcall tfunc(void* thisptr) { static_cast<DThread*>(thisptr)->run(); return 0; } //other stuff } The run function is implemented in a derived class. Why is the function that's being called in the thread being called through a cast this pointer? Is this good practise? Can't it just be called directly? The actual function needing to run is in the derived class. My question is

    Read the article

  • boost::function & boost::lambda - call site invocation & accessing _1 and _2 as the type

    - by John Dibling
    Sorry for the confusing title. Let me explain via code: #include <string> #include <boost\function.hpp> #include <boost\lambda\lambda.hpp> #include <iostream> int main() { using namespace boost::lambda; boost::function<std::string(std::string, std::string)> f = _1.append(_2); std::string s = f("Hello", "There"); std::cout << s; return 0; } I'm trying to use function to create a function that uses the labda expressions to create a new return value, and invoke that function at the call site, s = f("Hello", "There"); When I compile this, I get: 1>------ Build started: Project: hacks, Configuration: Debug x64 ------ 1>Compiling... 1>main.cpp 1>.\main.cpp(11) : error C2039: 'append' : is not a member of 'boost::lambda::lambda_functor<T>' 1> with 1> [ 1> T=boost::lambda::placeholder<1> 1> ] Using MSVC 9. My fundamental understanding of function and lambdas may be lacking. The tutorials and docs did not help so far this morning. How do I do what I'm trying to do?

    Read the article

  • JNI cached jclass global reference variables being garbage collected?

    - by bubbadoughball
    I'm working in the JNI Invocation API, calling into Java from C. I have some upfront initialization to cache 30+ Java classes into global references. The results of FindClass are passed into NewGlobalRef to acquire a global reference to the class. I'm caching these class variables to reuse them later. I have 30+ global references to classes (and 30+ global methodIDs for the class constructors). In the following sample, I've removed exception handling as well as JNI invocation for the purpose of shortening the code snippet. My working code has exception checks after every JNI call and I'm running with -Xcheck:jni. Here's the snippet: jclass aClass; jclass bClass; jmethodID aCtor; jmethodID bCtor; void getGlobalRef(const char* clazz, jclass* globalClass) { jclass local = (*jenv)->FindClass(jenv,clazz); if (local) { *globalClass = (jclass) (*jenv)->NewGlobalRef(jenv,local); (*jenv)->DeleteLocalRef(jenv,local); } } methodID getMethodID(jclass clazz, const char* method, const char* sig) { return (*jenv)->GetMethodID(jenv,clazz,method,sig); } void initializeJNI() { getGlobalRef("MyProj/Testclass1", &aclass); getGlobalRef("MyProj/Testclass2", &bclass); . . aCtor = getMethodID(aclass,"<init>","()V"); bCtor = getMethodID(bclass,"<init>","(I)V"); } The initializeJNI() function sets the global references for jclasses and method IDs for constructors as well as some jfieldID's and some initialization of C data structures. After initialization, when I call into a JNI function using some of the cached jclasses and ctor jmethodIDs, I get a bad global or local reference calling reported from the -Xcheck:jni. In gdb, I break at the last line of initializeJNI(), and print all jclasses and jmethodIDs and the ones causing problems look to have been turned into garbage or garbage-collected (i.e. 0x00 or 0x06). Is it possible for global references to be gc'ed? Any suggestions?

    Read the article

  • How to solve Memory leaks in Lib Xml Parser in objective-C where the list is returned?

    - by Madan Mohan
    Hi Guys, I got leaks in Lib Xml Parser while retrieving the data from the net, Here in the below code, I have allocated the list - (void)getCustomersList { // make an operation so we can push it into the queue SEL method = @selector(parseForData); NSInvocationOperation *op = [[NSInvocationOperation alloc] initWithTarget:self selector:method object:nil]; customersTempList = [[NSMutableArray alloc] initWithCapacity:20];// allocated list [self.retrieverQueue addOperation:op]; [op release]; } // return each recode // in parser .m class one of the condition in endElement where it shows a leak. else if(0 == strncmp((const char *)localname, kCustomerElement, kCustomerElementLength)) { [customersTempList addObject:customer]; printf("\n no of objects in temp list:%d", [customersTempList count]); if ([customersTempList count] == 20) { NSMutableArray* argsList = [customersTempList copy];//////////////////////here it is showing leak. printf("\n Calling reload data with %d new objects", [argsList count]); SEL selector = @selector(parser:addCustomerObject:); NSMethodSignature *sig = [(id)self.delegate methodSignatureForSelector:selector]; if(nil != sig && [self.delegate respondsToSelector:selector]) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; [invocation retainArguments]; [invocation setTarget:self.delegate]; [invocation setSelector:selector]; [invocation setArgument:&self atIndex:2]; [invocation setArgument:&argsList atIndex:3]; [invocation performSelectorOnMainThread:@selector(invoke) withObject:NULL waitUntilDone:NO]; } [customersTempList removeAllObjects]; } } // returned the list after all the records are stored in the list else if(0 == strncmp((const char *)localname, kCustomersElement, kCustomersElementLength)) { printf("\n Calling reload data with %d new objects", [customersTempList count]); NSMutableArray* argsList = [customersTempList copy]; printf("\n Calling reload data with %d new objects", [argsList count]); SEL selector = @selector(parser:addCustomerObject:); NSMethodSignature *sig = [(id)self.delegate methodSignatureForSelector:selector]; if(nil != sig && [self.delegate respondsToSelector:selector]) { NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:sig]; [invocation retainArguments]; [invocation setTarget:self.delegate]; [invocation setSelector:selector]; [invocation setArgument:&self atIndex:2]; [invocation setArgument:&argsList atIndex:3]; [invocation performSelectorOnMainThread:@selector(invoke) withObject:NULL waitUntilDone:NO]; } [customersTempList removeAllObjects]; } } please help me out of this, Thanks, Madan.

    Read the article

  • Java performance issue

    - by Colby77
    Hi, I've got a question related to java performance and method execution. In my app there are a lot of place where I have to validate some parameter, so I've written a Validator class and put all the validation methods into it. Here is an example: public class NumberValidator { public static short shortValidator(String s) throws ValidationException{ try{ short sh = Short.parseShort(s); if(sh < 1){ throw new ValidationException(); } return sh; }catch (Exception e) { throw new ValidationException("The parameter is wrong!"); } } ... But I'm thinking about that. Is this OK? It's OO and modularized, but - considering performance - is it a good idea? What if I had awful lot of invocation at the same time? The snippet above is short and fast, but there are some methods that take more time. What happens when there are a lot of calling to a static method or an instance method in the same class and the method is not synchronized? All the calling methods have to fall in line and the JVM executes them sequentially? Is it a good idea to have some class that are identical to the above-mentioned and randomly call their identical methods? I think it is not, because "Don't repeat yourself " and "Duplication is Evil" etc. But what about performance? Thanks is advance.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >