Search Results

Search found 10634 results on 426 pages for 'pass'.

Page 17/426 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • How to pass variables using Unittest suite

    - by chrissygormley
    Hello I have test's using unittest. I have a test suite and I am trying to pass variables through into each of the tests. The below code shows the test suite used. class suite(): def suite(self): #Function stores all the modules to be tested modules_to_test = ('testmodule1', 'testmodule2') alltests = unittest.TestSuite() for module in map(__import__, modules_to_test): alltests.addTest(unittest.findTestCases(module)) return alltests It calls tests, I would like to know how to pass variables into the tests from this class. An example test script is below: class TestThis(unittest.TestCase): def runTest(self): assertEqual('1', '1') class TestThisTestSuite(unittest.TestSuite): # Tests to be tested by test suite def makeTestThisTestSuite(): suite = unittest.TestSuite() suite.addTest("TestThis") return suite def suite(): return unittest.makeSuite(TestThis) if __name__ == '__main__': unittest.main() So from the class suite() I would like to enter in a value to change the value that is in assert value. Eg. assertEqual(self.value, '1'). I have tried sys.argv for unittest and it doesn't seem to work. Thanks for any help.

    Read the article

  • Scared of Calculus - Required to pass Differential Calculus as part of my Computer science major

    - by ke3pup
    Hi guys I'm finishing my Computer science degree in university but my fear of maths (lack of background knowledge) made me to leave all my maths units til' the very end which is now. i either take them on and pass or have to give up. I've passed all my programming units easily but knowing my poor maths skills won't do i've been staying clear of the maths units. I have to pass Differential Calculus and Linear Algebra first. With a help of book named "Linear Algebra: A Modern Introduction" i'm finding myself on track and i think i can pass the Linear Algebra unit. But with differential calculus i can't find a book to help me. They're either too advanced or just too simple for what i have to learn. The things i'm required to know for this units are: Set notation, the real number line, Complex numbers in cartesian form. Complex plane, modulus. Complex numbers in polar form. De Moivre’s Theorem. Complex powers and nth roots. Definition of ei? and ez for z complex. Applications to trigonometry. Revision of domain and range of a function Working in R3. Curves and surfaces. Functions of 2 variables. Level curves.Partial derivatives and tangent planes. The derivative as a difference quotient. Geometric significance of the derivative. Discussion of limit. Higher order partial derivatives. Limits of f(x,y). Continuity. Maxima and minima of f(x,y). The chain rule. Implicit differentiation. Directional derivatives and the gradient. Limit laws, l’Hoˆpital’s rule, composition law. Definition of sinh and cosh and their inverses. Taylor polynomials. The remainder term. Taylor series. Is there a book to help me get on track with the above? Being a student i can't buy too many books hence why i'm looking for a book that covers topics I need to know. The University library has a fairly limited collection which i took as loan but didn't find useful as it was too complex.

    Read the article

  • Process.Start - Pass html code to exe as argument

    - by dkirk
    Hello, I am using the code below to start a executable file from a windows service and I need to pass html code (stored in a variable) as an argument. I am escaping with double quotes but this is not working. What do I need to do in order to pass this correctly? Thanks in advance for any guidance that is offered. Inside the service: Process.Start(@"E:\Program Files\MyApp.exe", dr["rec"].ToString() + " \"" + subject + "\" \"" + htmlVar); and then within MyApp.exe: static void Main(string[] args) { Program MyProg = new Program(); MyProg.MyMeth(args[0].ToString(), args[1].ToString(), args[2].ToString()); }

    Read the article

  • AS3 Pass FlashVars to loaded swf

    - by Robin
    Hi I have a A.swf which loads B.swf onto a movieclip and needs to pass it some FlashVars. When loading B.swf with html, I can pass FlashVars fine. When passing from A.swf, it gets a Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file: The code in A.swf is var request:URLRequest = new URLRequest ("B.swf"); var variables : URLVariables = new URLVariables(); variables.xml = "test.xml"; // This line causes the error 2044, else B.swf loads fine with FlashVars request.data = variables; loader.load (request); In B.swf, it is checking the Flashvars like so. It works fine from html side this.loaderInfo.parameters.xml

    Read the article

  • Pass HTML-DOM to Flex's actionscript.

    - by raj
    Hi, All i want is to pass a HTML-Form (DOM object) from javascript to Actionscript. i saw this article on the net and tried a similar code. But when i execute the code in IE, it alerts : "Out of memory at line 18". I'm stuck here from yesterday. i'll post the mxml and html here.. The MXML : <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()"> <mx:Script> <![CDATA[ public function init() : void { if (ExternalInterface.available) { try { ExternalInterface.addCallback("populateFlashFile", populateFlashFile); } catch (error:SecurityError) { } catch (error:Error) { } } } public function populateFlashFile(window:*) : void { log.text = window.toString(); // just for checking if window has come to the function. window.document.write("Hello"); } ]]> </mx:Script> <mx:TextArea x="10" y="23" width="712" height="581" id="log"/> </mx:Application> The HTML : <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body scroll="no"> <input type="button" onclick="document.getElementById('Test').populateFlashFile(window);"/> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="Test" width="100%" height="100%" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> <param name="movie" value="Test.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#869ca7" /> <param name="allowScriptAccess" value="sameDomain" /> </object> </body> </html> The problem occors only when i pass some DOM object, if i pass some String it works.!!! i.e : <input type="button" onclick="document.getElementById('Test').populateFlashFile('some text here');"/> works great!

    Read the article

  • C# - Process.Start - Pass html code to exe as argument

    - by dkirk
    Hello, I am using the code below to start a executable file from a windows service and I need to pass html code (stored in a variable) as an argument. I am escaping with double quotes but this is not working. What do I need to do in order to pass this correctly? Thanks in advance for any guidance that is offered. Inside the service: Process.Start(@"E:\Program Files\MyApp.exe", dr["rec"].ToString() + " \"" + subject + "\" \"" + htmlVar); and then within MyApp.exe: static void Main(string[] args) { Program MyProg = new Program(); MyProg.MyMeth(args[0].ToString(), args[1].ToString(), args[2].ToString()); }

    Read the article

  • Errors/warnings passing int/char arrays by reference

    - by Ankur Banerjee
    I'm working on a program where I try to pass parameters by reference. I'm trying to pass a 2D int array and a 1D char array by reference. Function prototype: void foo (int* (&a)[2][2], char* (&b)[4]) Function call: foo (a, b); However, when I compile the code with -ansi and -Wall flags on gcc, I get the following errors: foo.c: At top level: error: expected ‘)’ before ‘&’ token error: expected ‘;’, ‘,’ or ‘)’ before ‘char’ foo.c: In function ‘main’: error: too many arguments to function ‘foo’ I've stripped out the rest of the code of my program and concentrated on the bits which throw up the errors. I've searched around on StackOverflow and tried out different ways to pass the parameters, but none of them seem to work. (I took this way of passing parameters from the discussion on StackOverflow here.) Could you please tell me where I'm going wrong?

    Read the article

  • pass form builder in remote_function in rails ?

    - by richard moss
    hi all i have select box where on change i need to grab the value and via remote function get some field names from db and then generate those field further down the form depwning on whatoption from the select box is chosen. The problem is is that the fields are in a f.form_for so are using the formbuilder f that has the select box in. So when i render the partial via ajax in the controller i get an error as i dont have a reference to the local form builder f. does anyone know how or if i can get reference to the form builder orif can pass it in a remote function call and then pass into my locals in the partial ? thanks alot, any help will be great as been stuck on this a long time! cheers rick

    Read the article

  • jsFunction pass data to backingbean

    - by deilig
    I have a javascript that is calling a function addData(param1,param2,param3,param4) which is calling addClip at the end And I need to pass those to a backing bean. <a4j:form> <a4j:jsFunction name="addClip" action="#{backingBean.goGo}"> <a4j:actionparam name="param1" assignTo="#{backingBean.param1}"/> </a4j:jsFunction> </a4j:form> But I can't seem to pass any values to the backingbean. I've even tried setting a static value for the actionparam. But when I try to do a Systemout on the setParam1 method it only prints out null. Have I missed anything important?

    Read the article

  • Pass variable to Google Custom Search Engine

    - by Matt
    Is it possible to pass a search variable into the Google Custom Search Engine that I have embedded on my website? I can get the search engine to work, but I can't pass it a term via POST (it's coming from a search button on other pages of the website) I tried to hack the code I found here: http://code.google.com/apis/ajax/playground/?exp=search#hello_world And this is what I have so far... ($q is the term I am passing to it) <script type="text/javascript"> google.load('search', '1', {language : 'en'}); function OnLoad() { var customSearchControl = new google.search.CustomSearchControl('***my key****'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); customSearchControl.draw('cse'); searchControl.execute("$q"); } google.setOnLoadCallback(OnLoad); </script> Thanks

    Read the article

  • How to pass jQuery variable with AJAX to PHP page

    - by Walden
    Trying to pass the variable "flickrurl" to a PHP page with jQuery/ajax. It works when using a plain text string and not the variable. Am I assigning the variable properly? see the full code in action here: http://is.gd/c9ytI $trash.droppable({ accept: '#gallery > li', activeClass: 'ui-state-highlight', drop: function(ev, ui) { deleteImage(ui.draggable); //set variable equal to src of image tag in #gallery > li var $flickrurl = $item.find('img').attr("src"); //pass variable to php page $.post("updateDB.php", $flickrurl ); } });

    Read the article

  • Unable to pass variable data

    - by JM4
    I am trying to use the following code to pass information to another site but it keeps giving me an error: Invalid Code: $a = $b->doIt("James",$_SESSION['JNum'],"Frank"); Valid Sample Code: $a = $b->doIt("James","123456","Frank"); In the first example, the page returns "number field is required". The second piece of sample code returns valid results. Do to the nature of this project though I need to pass the id number as they are stored in SESSION variables. What am I missing?

    Read the article

  • Pass through touches to portion of UIWebView

    - by cannyboy
    I have a UIWebView. Using something like this: http://blog.evandavey.com/2009/02/how-to-make-uiwebview-transparent.html .. I have made the UIWebView transparent. I now need to be able to pass though touches on the webview to the view below, but only on a rectangular portion of the web view. So, imagine the webview is a square, and it has a square area in the centre which must pass-thru touches to the view below. Is there a way to do this?

    Read the article

  • VB.Net List.Find. Pass values to predicate

    - by Beta033
    Having a bit of trouble using the List.Find with a custom predicate i have a function that does this private function test () Dim test As Integer = keys.Find(AddressOf FindByOldKeyAndName).NewKey here's the function for the predicate Private Shared Function FindByOldKeyAndName(ByVal k As KeyObj) As Boolean If k.OldKey = currentKey.OldKey And k.KeyName = currentKey.KeyName Then Return True Else Return False End If End Function by doing it this way means i have to have a shared "currentKey" object in the class, and i know there has to be a way to pass in the values i'm interested in of CurrentKey (namely, keyname, and oldkey) ideally i'd like to call it by something like keys.Find(AddressOf FindByOldKeyAndName(Name,OldVal)) however when i do this i get compiler errors. How do i call this method and pass in the values?

    Read the article

  • When to pass by value?

    - by Dervin Thunk
    Dear all. I was wondering if there are examples of situations where you would purposefully pass an argument by value in C. Let me rephrase. When do you purposefully use C's pass-by-value for large objects? Or, when do you care that the object argument is fully copied in a local variable? EDIT: Now that I think about it, if you can avoid pointers, then do. Nowadays, "deep" copying is possible for mostly everything in small apps, and shallow copying is more prone to pointer bugs. Maybe.

    Read the article

  • How can I pass methods in javascript?

    - by peterjwest
    I often need to pass methods from objects into other objects. However I usually want the method to be attached to the original object (by attached I mean 'this' should refer to the original object). I know a few ways to do this: a) In the object constructor: ObjectA = function() { var that = this; var method = function(a,b,c) { that.abc = a+b+c }} b) In objectA which has been passed objectB: objectB.assign(function(a,b,c) { that.method(a,b,c) }) c) Outside both objects: objectB.assign(function(a,b,c) { objectA.method(a,b,c) }) I want to know if there is a simpler way to pass methods attached to their original objects.

    Read the article

  • Auto enter pass phrase in case of Python ssl Client/Server

    - by rauch
    I need to create Client/Server application to send files from clients to Server. I use simple ssl sockets for that and authenticate with certificates. ms = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ssl_sock = ssl.wrap_socket(ms, keyfile=".../newCA/my_client.key", certfile=".../newCA/my_client.crt", server_side=0, cert_reqs=ssl.CERT_REQUIRED, ca_certs=".../newCA/CA/my-ca.crt" ) ssl_sock.connect((HOST, MPORT)) And Server side: msock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.ssl_sock = ssl.wrap_socket(msock, keyfile=".../newCA/my_server.key", certfile=".../newCA/my_server.crt", server_side=1, cert_reqs=ssl.CERT_REQUIRED, ca_certs=".../newCA/CA/my-ca.crt" ) self.ssl_sock.bind(('', self.PORT)) self.ssl_sock.listen(self.QUEUE_MAX) The problem is the following: when client tries to connect to Server, it requires Enter the pass phrase for private key for Both: for Server-side and Client-side. In Java we need to set System Property: javax.net.ssl.keyStorePassword="" and it has to be used automatically, But how is it been used in Python? I can't enter pass phrase all time the client connects.

    Read the article

  • how to use trigger in Jquery to pass parameter data as well as control (this)

    - by Shantanu Gupta
    I am trying to use same validation funtion for all my controls. But I dont know much in jquery and not been able to pass event handler to the trigger. I want to pass textbox id to my custom function. How can i do this <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("#txtFirstName").bind('focusout', function() { $(this).trigger("customblurfocus",[$(this).val(), $(this).val() + " Required !", "Ok !"]); } ); $(this).bind('customblurfocus',function(defaultInputValue,ErrorMessage,ValidMessage) {alert($(this).val()); if($(this).val()=="" || $(this).val()==defaultInputValue) { $(this).val(defaultInputValue); $(this).siblings("span[id*='error']").toggleClass("error_set").text(ErrorMessage).fadeOut(3000); } else { $(this).siblings("span[id*='error']").toggleClass("error_ok").text(ValidMessage).show(1000); } } ); }); </script>

    Read the article

  • CCK NodeReference - Pass current user id as argument to selection view

    - by Chaulky
    Hi all, I'm trying to create a view to limit the options available to a user for a CCK NodeReference field. I want to pass the current user's ID as an argument to the view that selects the options for the CCK NodeReference field. Basically when the user creates a new item, I only want them to be able to reference a node which they created (not someone else's node). I've got a view set up that accepts a user ID as an argument, but how do I pass the current user's ID to the view from the CCK NodeReference field? Thanks in advance!!!

    Read the article

  • Perl TK : How to pass arguments to subroutines

    - by kiruthika
    Hi all, I have designed one sign-up form,in this form after getting all necessary values I will click submit button. And while clicking that submit button I want to call one function and I want to pass the arguments to that function. I have written code for this purpose,but the function is called first before getting the details.(i.e)after getting the details in sign-up form I need to pass these values to one function and I need to validate those values. But what happened was,before getting the details the function get called. Please help me in this issue. Thanks in advance..

    Read the article

  • How to pass operators as parameters

    - by Rodion Ingles
    I have to load an array of doubles from a file, multiply each element by a value in a table (different values for different elements), do some work on it, invert the multiplication (that is, divide) and then save the data back to file. Currently I implement the multiplication and division process in two separate methods. Now there is some extra work behind the scenes but apart from the specific statements where the multiplication/division occurs, the rest of the code is identical. As you can imagine, with this approach you have to be very careful making any changes. The surrounding code is not trivial, so its either a case of manually editing each method or copying changes from one method to the other and remembering to change the * and / operators. After too many close calls I am fed up of this and would like to make a common function which implements the common logic and two wrapper functions which pass which operator to use as a parameter. My initial approach was to use function pointers: MultiplyData(double data) { TransformData(data, &(operator *)); } DivideData(double data) { TransformData(data, &(operator /)); } TransformData(double data, double (*func)(double op1, double op2)) { /* Do stuff here... */ } However, I can't pass the operators as pointers (is this because it is an operator on a native type?), so I tried to use function objects. Initially I thought that multiplies and divides functors in <functional> would be ideal: MultiplyData(double data) { std::multiplies<double> multFunct; TransformData(data, &multFunct); } DivideData(double data) { std::divides<double> divFunct; TransformData(data, &divFunct); } TransformData(double data, std::binary_function<double, double, double> *funct) { /* Do stuff here... */ } As you can see I was trying to use a base class pointer to pass the functor polymorphically. The problem is that std::binary_function does not declare an operator() member for the child classes to implement. Is there something I am missing, or is the solution to implement my own functor heirarchy (which really seems more trouble than it is worth)?

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >