Search Results

Search found 23968 results on 959 pages for 'tail call'.

Page 93/959 | < Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >

  • How would one call std::forward on all arguments in a variadic function?

    - by Noah Roberts
    I was just writing a generic object factory and using the boost preprocessor meta-library to make a variadic template (using 2010 and it doesn't support them). My function uses rval references and std::forward to do perfect forwarding and it got me thinking...when C++0X comes out and I had a standard compiler I would do this with real variadic templates. How though, would I call std::forward on the arguments? template < typename ... Params void f(Params ... params) // how do I say these are rvalue reference? { y(std::forward(...params)); //? - I doubt this would work. } Only way I can think of would require manual unpacking of ...params and I'm not quite there yet either. Is there a quicker syntax that would work?

    Read the article

  • Call external library from PHP. What is faster: exec or extension?

    - by robusta
    Hi, I need to make calls from webpage to external library written in C++ and display the result. Platform is Linux, Apache, PHP. My current idea is to use PHP service which will call my library/program. I found that there are two possible ways to do this: 1) use PHP 'exec' function 2) write PHP extension I am curious what works more effective? Faster? Less load the server? I will probably need to do 4 calls per second, so I want to be as optimal as possible. P.S. If you are aware of some other (more effective) way of calling C++ library or program from webpage, please let me know. Thanks a lot, Robusta

    Read the article

  • const member functions can call const member functions only?

    - by Abhi
    Hi all. Do const member functions call only const member functions? class Transmitter{ const static string msg; mutable int size; public: void xmit() const{ size = compute(); cout<<msg; } private: int compute() const{return 5;} }; string const Transmitter::msg = "beep"; int main(){ Transmitter t; t.xmit(); return EXIT_SUCCESS; } If i dont make compute() a const, then the compiler complains. Is it because since a const member function is not allowed to modify members, it wont allow any calls to non-consts since it would mean that the const member function would be 'indirectly' modifying the data members?

    Read the article

  • How to call method written in C# class library from Silverlight application(xaml.cs file) ?

    - by Shyju
    Can a Silverlight application call a method in a full .NET c# class library? I am trying to add a Silverlight control to my Existing ASP.NET project where i used to add reference to my Business Logic Project and access methods from My UI pages of ASP.NET Web application. Now I have added one Silverlight project to my solution. How can I use the already existing BL method which is in a C# class library ? When tried to add reference, it is saying that "You can only add project reference to other silver light projects in the solution". Should i give up ? Is there any way to get rid of this ?

    Read the article

  • How to call function on parent page from iframe using jQuery?

    - by Michael
    I have an upload form that posts to a hidden iframe. I am attempting to call a function on the parent page from the iframe, but am getting the error "top.stopUpload is not a function". What is the correct way to do this? PARENT PAGE: $(document).ready(function() { $('#document_upload').submit( function() { $('#upload_progress').show(); }); function stopUpload(success){ if (success == 1){ $('#result', window.parent.document).html( '<span class="msg">The file was uploaded successfully!<\/span>'); } else { $('#result', window.parent.document).html( '<span class="emsg">There was an error during file upload!<\/span>'); } $('#upload_progress').hide(); return true; } }) IFRAME: $(document).ready(function() { top.stopUpload(<?php echo $result; ?>); }

    Read the article

  • How to call a function from a shared library?

    - by Frank
    What is the easiest and safest way to call a function from a shared library / dll? I am mostly interested in doing this on linux, but it would be better if there were a platform-independent way. Could someone provide example code to show how to make the following work, where the user has compiled his own version of foo into a shared library? // function prototype, implementation loaded at runtime: std::string foo(const std::string); int main(int argc, char** argv) { LoadLibrary(argv[1]); // loads library implementing foo std::cout << "Result: " << foo("test"); return 0; } BTW, I know how to compile the shared lib (foo.so), I just need to know an easy way to load it at runtime.

    Read the article

  • How to Get the Method/Function Call Trace for a Specific Run?

    - by JackWM
    Given a Java or JavaScript program, after its execution, print out a sequence of calls. The calls are in invocation order. E.g. main() { A(); } A() { B(); C(); } Then the call trace should be: main -> A() -> B() -> C() Is there any tool that can profile and output this kind of information? It seems this is common a need for debugging or performance tuning. I noticed that some profilers can do this, but I prefer a simpler/easy-to-use one. Thanks!

    Read the article

  • scala coalesces multiple function call parameters into a Tuple -- can this be disabled?

    - by landon9720
    This is a troublesome violation of type safety in my project, so I'm looking for a way to disable it. It seems that if a function takes an AnyRef (or a java.lang.Object), you can call the function with any combination of parameters, and Scala will coalesce the parameters into a Tuple object and invoke the function. In my case the function isn't expecting a Tuple, and fails at runtime. I would expect this situation to be caught at compile time. object WhyTuple { def main(args: Array[String]): Unit = { fooIt("foo", "bar") } def fooIt(o: AnyRef) { println(o.toString) } } Output: (foo,bar)

    Read the article

  • How to make a call to an executable from Python script?

    - by fx
    I need to execute this script from my Python script. Is it possible? The script generate some outputs with some files being written. How do I access these files? I have tried with subprocess call function but without success. fx@fx-ubuntu:~/Documents/projects/foo$ bin/bar -c somefile.xml -d text.txt -r aString -f anotherString >output The application "bar" also references to some libraries, it also creates some files besides the output. How do I get access to these files? Just by using open()? Thank you,

    Read the article

  • Do you have to call .Save() when modifying a application setting that is bound to a control property

    - by Jordan S
    I am programming in .NET I have an application setting of type string. On my form I have a textbox. I bound the text property of the textbox to my application setting. If I type something in the textbox it changes the value that is held in the Application setting but the next time I start the program it goes back to the default value. Do I need to call Properties.Settings.Default.Save(); after the text is entered for the new value to be saved? Shouldn't it do this automatically? Is there a way I can make it do it automatically?

    Read the article

  • Force to call virtual base function instead of the overriden one.

    - by Roberto Sebestyen
    In the following example "Test that v1 function was called" fails. Is there a way to force call the base implementation of "RunFunction" through an instance of "class V2" ?? class V1 { public virtual string RunFunction() { return "V1"; } } class V2 : V1 { public override string RunFunction() { return "V2"; } } [Test] public void TestCall() { var v1 = (V1)new V2(); var v2 = new V2(); Assert.IsTrue(v1.RunFunction() == "V1", "Test that v1 function was called"); Assert.IsTrue(v2.RunFunction() == "V2", "Test that v2 function was called"); }

    Read the article

  • When would I need to call base() in C#?

    - by user310291
    My BaseClass Constructor is called whereas I have a constructor in derived class so when would I need to call base() ? class BaseClass { public BaseClass() { Debug.Print("BaseClass"); } } class InheritedClass : BaseClass { public InheritedClass() { Debug.Print("InheritedClass"); } } private void Form1_Load(object sender, EventArgs e) { InheritedClass inheritedClass = new InheritedClass(); } Output 'Inheritance.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll' 'Inheritance.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. BaseClass InheritedClass The thread 'vshost.RunParkingWindow' (0x12b4) has exited with code 0 (0x0). The thread '<No Name>' (0x85c) has exited with code 0 (0x0). The program '[4368] Inheritance.vshost.exe: Program Trace' has exited with code 0 (0x0). The program '[4368] Inheritance.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).

    Read the article

  • AS3 - Can I have access to the object (or function) who call me?

    - by lk
    I've asked this same question with Python. Now I like to know if this can be done in AS3. If I have something like this: package { public class SomeClass { private function A():void { C() } private function B():void { C() } private function C():void { // who is the caller, A or B ??? } public function SomeClass() { A() B() } } } Despite the design or other issues, this is only a question of an inquiring mind. Note: This has to be done without changing C signature Note 2: I like to have an access to an instance of the caller function so I can call that caller function (if I want to)

    Read the article

  • Can we manage incoming call number landing on asterisk?

    - by user194469
    I am using Asterisk 1.4.2 in two different machine. I have configured some extensions in asterisk. When any caller, dial my extension number with local number then if I see asterisk console (asterisk -r) then incoming number is starting with 0, but if caller dial same extension number using STD number then in asterisk console (asterisk -r), incoming number is staring with 0091 (here 91 is country code). Could I change this setting or is there any standard for asterisk for local, STD or ISD number?

    Read the article

  • I've set an editor as default, how do I call it to open files in a shell?

    - by iight
    EDIT I thought of a better way to phrase the question. How can I find the alias that Ubuntu is using for a different text editor? Rather than using nano by typing nano file.txt, i'd like to be able to type sublime file.txt to open sublime editor. I don't know where to look to find these aliases. sudo update-alternatives --config editor does not show it as a choice, I only see the 'default' editors, like Nano and vim.tiny.

    Read the article

  • Evernote from vim

    - by juanpablo
    I search a way to edit evernote notes from vim I begin with this #!/bin/bash evernoteDir="$HOME/Library/Application*Support/Evernote/data" dataDir=$(ls -trlh $evernoteDir| tail -n 1| awk '{print $NF}') contentDir="$evernoteDir/$dataDir/content" file=$(ls -trlh $contentDir | tail -n 1| awk '{print $NF}') vim -c 's/div>/div>\r/g' $contentDir/$file/content.html https://gist.github.com/1256416 or maybe create a vim plugin for this ... you have any suggestion? EDIT: for a more simple edition of the evernote note in html format, I make this vim function " Markup function {{{ fun! MkdToHtml() "{{{ " markdown to html silent! execute '%s/ $/<br\/>/g' silent! execute '%s/\*\*\(.*\)\*\*/<b>\1<\/b>/g' silent! execute '%s/\t*###\(.*\)/<H3>\1<\/H3>/g' endf "}}} command! -complete=command MkdToHtml call MkdToHtml() nn <silent> <leader>mm :MkdToHtml<CR> " }}} and a vim function for open the last note edited fun! LastEvernote() "{{{ " a better solution is with evernote api let evernoteDir=expand("$HOME")."/Library/Application*Support/Evernote/data" let dataDir=system("ls -trlh ".evernoteDir."| tail -n 1| awk '{print $NF}'") let contentDir=evernoteDir."/".dataDir."/content" let contentDir=substitute(contentDir,"\n","",'g') let note=system("ls -trlh ".contentDir." | tail -n 1| awk '{print $NF}'") let note=substitute(note,"\n","",'g') sil! exec 'sp '.contentDir.'/'.note.'/content.html' sil! exec '1s/>/>\r/g' sil! exec '%s/<br.*\/>/<br\/>\r/g' sil! exec '%s/<\//\r<\//g' sil! exec 'g/^\s*$/d' normal gg sil! exec '1,4fo' sil! exec '$-1,$fo' endf https://gist.github.com/1289727

    Read the article

  • I have nice headphones. Need a wireless USB microphone so I don't have to switch to a headset to make a call

    - by mattalexx
    Right now, I have a pair of Sennheiser HD595 headphones. They are plugged into a DAC/headphone amp. I spend all day listening to music through them and they sound awesome. Then, for making calls, I have a wireless USB headset from Logitech. Problem is, I can't make calls when I'm wearing my Sennheisers but I wouldn't want to listen to music all day using the Logitech headset. So I spend my day switching in between. So the question is, how can I make calls while wearing the headphones of my choice? One thing I thought of is a wireless USB microphone that I can clip to the Sennheisers. So I'd wear the Sennheisers with this mic all day and ditch the Logitech headset. But it doesn't look like anyone makes a microphone like this. By the way, I would love if the solution didn't transmit the sound of my clacky keyboard or noisy wood flooring.

    Read the article

  • What is wrong with this call to schtasks on Win 7?

    - by Jost
    I'm trying to run this in a Win 7 Professional admin console: schtasks /create /tn "Task at 16:40 on 10/27/2012" /sc "once" /st "16:40" /sd "10/27/2012" /tr "c:\python27\python.exe c:\users\jost\Desktop\executeScript.py" All referenced files exist. The error message I get is ERROR: The filename, directory name, or volume label syntax is incorrect. What is wrong? Running the command directly on the command line works fine.

    Read the article

  • How to call a program and exit from the shell (the caller) when program is active?

    - by Jack
    I want to run a program with GUI, by typing into konsole: foo args … and exit from the shell (that's the caller) when the program (foo) is active. How do I this? Is there a Linux/Unix built-in command/program to do it? I'm not a shell-man, really. I know that it's possible by writing a small program in C or C++ (any other programming language with small I/O interface on POSIX) programming language with the fork() and one-of exec*() function family. It may take some time; I'll do it only if there is no native solution. Sorry for my bad English; it's not my native language. Also, not sure on tags, please edit for me, if I'm wrong. If it matters, I'm using OpenSUSE 10.x.

    Read the article

  • How to force Windows to call the partition it installs on C:?

    - by maaartinus
    I'm going to install Windows XP from a CD and want to make sure it calls the partition it lands on C:. The target partition is the first one on a SATA disk, which is not the first one in my computer. There's no IDE disk there. I don't think I can swap the disks, as I'm using a fake RAID and really don't want to get problems with it. The target partition is on a normal disk. I know it may be unimportant, but I don't want to run in any problems I can avoid. I've seen a question slightly related to it, but I'm not going to install from a USB.

    Read the article

  • Can a Windows batch file call another program without waiting for that program to finish?

    - by iconoclast
    I'm using Windows 7, and have a simple batch file to copy portable executables off my thumb drive to %TEMP%, and then start them. The goal is to prevent Windows from holding my thumbdrive hostage until I kill all the programs I started up from it. However the control flow does not continue to the next app unless I kill the first one, which obviously doesn't work for this purpose. In a Unix shell script I'd simply add & after the executable I start up, but I can't find an equivalent for batch files. How can I do this?

    Read the article

  • SAXException: bad envelope tag

    - by David Guzman
    I'm trying to connect to a webservice https protected through a webservice client. Eclipse generated a stub based webservice client and looks nice to me. The problem comes when I try to call a method from the webservice: String a = (String)webservice.userProfileServices(xml); I'm also using the following SOAP headers: esgGatewayPort = (new EsgGatewayLocator()).getesgGatewayPort(); //setting the authentication header PrefixedQName name = new PrefixedQName("http://schemas.xmlsoap.org/ws/2002/07/secext","Security","wsse"); System.out.println("Setting headers for authentication"); org.apache.axis.message.SOAPHeaderElement sh = new org.apache.axis.message.SOAPHeaderElement(name); SOAPElement sub; try { String clntUserName="myUser"; String clntPassword="myPassword"; sub = sh.addChildElement("UsernameToken"); SOAPElement element = sub.addChildElement("Username"); element.addTextNode(clntUserName); element = sub.addChildElement("Password"); element.addTextNode(clntPassword); ((org.apache.axis.client.Stub) esgGatewayPort).setHeader(sh); } catch (SOAPException e) { e.printStackTrace(); } I receive the following: AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXException: Bad envelope tag: HTML faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: Bad envelope tag: HTML at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:71) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:133) at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:153) at javax.xml.parsers.SAXParser.parse(Unknown Source) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) Any help will be truly appreciated David

    Read the article

< Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >