Search Results

Search found 7418 results on 297 pages for 'argument passing'.

Page 11/297 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Swift : missing argument label 'xxx' in call

    - by henry4343
    func say(name:String, msg:String) { println("\(name) say \(msg)") } say("Henry","Hi,Swift") <---- error because missing argument label 'msg' in call I need to use say("Henry",msg:"Hi,Swift") Why ? If I put more than two var in func so that I need to write var name instead of first var when I call this func It's really trouble, and I don't see any explain in iBook Swift tutorial. Can someone give me a help ... Thanks

    Read the article

  • Third argument in strstr is only valid in PHP 5.3.0

    - by Muhammad Sajid
    Hello I want to get user from an email address, eg: [email protected] then output must be sajid for this is use below mentioned code but an warning occur $user = strstr($email, '@', true); Warning: Wrong parameter count for strstr() in /var/www/DataTable/dialog.php on line 3 & in php manul it is clearly define that the 3rd argument true is only valid for PHP 5.3.0 So is there any string function which could solve my problem?

    Read the article

  • in python: can i pass class method as and a default argument to another class method

    - by alex
    i want to to pass class method as and a default argument to another class method, so that i can re-use the method as a @classmethod @classmethod class foo: def func1(self,x): do somthing; def func2(self, aFunc = self.func1): # make some a call to afunc afunc(4) this why when the method func2 is called within the class aFunc defaults to self.func1, but i can call this same function from outside of the class and pass it a different function at the input. i get NameError: name 'self' is not defined

    Read the article

  • asp.net custom templated datalist - throws argument out of range (index) on button press

    - by MrTortoise
    I have a class BaseTemplate public abstract class BaseTemplate : ITemplate This adds the controls, and provides abstract methods to implement in the inheriting class. The inheriting class then adds its html according to its data source and manages the data binding. this all works fine - I get the control appearing with properly parsed html. the problem is that the base class adds controls into the template that have their own CommandName arguments ... the idea is that the class that implements the custom templated dataList will provide the logic of setting the Selected and Edit Indexes. This class also manages the data binding etc. It sets all of the templates ont he datalist in the Init method (which was another cause of this exception). the exception gets throw when i hit one of these buttons .. but after the ItemCommand event is being processed. The stack trace does not include any references to my methods or objects which is why i am so stuck. The Exception Details Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index The Stack Trace: [ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index] System.Web.UI.ControlCollection.get_Item(Int32 index) +8665582 System.Web.UI.WebControls.DataList.GetItem(ListItemType itemType, Int32 repeatIndex) +8667655 System.Web.UI.WebControls.DataList.System.Web.UI.WebControls.IRepeatInfoUser.GetItemStyle(ListItemType itemType, Int32 repeatIndex) +11 System.Web.UI.WebControls.RepeatInfo.RenderVerticalRepeater(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl) +8640873 System.Web.UI.WebControls.RepeatInfo.RenderRepeater(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl) +27 System.Web.UI.WebControls.DataList.RenderContents(HtmlTextWriter writer) +208 System.Web.UI.WebControls.BaseDataList.Render(HtmlTextWriter writer) +30 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163 System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 System.Web.UI.Page.Render(HtmlTextWriter writer) +29 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266 This is driving me absolutley stark raving bonkers ... im talking cthulu style.

    Read the article

  • Is there a good argument for software patents?

    - by David Nehme
    Now that it looks like software patents are going to be severely limited, does anyone have a good argument for keeping them. It seems like copyright law serves software fine and patents just add overhead to what should be an almost frictionless process. Are there any examples of software that wouldn't have been written if not for patents?

    Read the article

  • Ninject: Controller Constructor with int argument

    - by Fleents
    How can you instantiate a Controller that has an int argument? Using Ninject.. My HomeController has a constructor like this: private int _masterId; Public HomeController(int masterId){ _masterId = masterId; } I created a controller factory like this: public class NinjectControllerFactory : DefaultControllerFactory { IKernel kernel = new StandardKernel(new ExampleConfigModule()); protected override IController GetControllerInstance(Type controllerType) { return controllerType == null ? null : (IController)kernel.Get(controllerType, 1); } }

    Read the article

  • variable argument list in windows va_list

    - by shrikant
    hi, I wanted to have function which will accept as foo(...) { } usage of this would be foo(1,2,3); foo(1) foo(1,2,3,4,5,5,6); va_list can be used but again for that I have to pass foo(int count, ...), as this at run time i dont know how many argument i have. any pointer would be appreciated Thanks

    Read the article

  • XCode: Function argument indentation

    - by user343317
    I was unable to find any solution of my specific issue. I'm using Xcode 3.2. I'd like to indent the next line of function argument just one step in from the previous line: somevariable = pow( a, b); However, Xcode's syntax-aware indenting insists on converting the above into: somevariable = pow( a, b); Where the arguments are aligned with opening parenthesis of the function. How can I make indenting be configured to match my preference?

    Read the article

  • Use subform record set as domain argument in DAvg()

    - by harto
    Is it possible to use a subform's 'current' record set as the domain argument to DAvg() (etc.)? Basically, I have a subform that displays a subset of records from a query. I would like to run DAvg() over this subset. This is how I've gotten around it: =DAvg([FieldToAvg], [SubformQuery], "ChildField=Forms.MasterForm.MasterField And FieldToAvg > 0") but what I actually want is something like: =DAvg([FieldToAvg], [SubformCurrentlyDisplayedData], "FieldToAvg > 0") Is this possible in Access 2007?

    Read the article

  • AbsoluteTime with an integer argument behaves strangely.

    - by dreeves
    This is strange: DateList@AbsoluteTime[596523] returns {2078, 7, 2, 2, 42, 9.7849} But DateList@AbsoluteTime[596524] returns {1942, 5, 26, 20, 28, 39.5596} The question: What's going on? Note that AbsoluteTime with an integer argument is undocumented. (I think I now know what it's doing but figured this is useful to have as a StackOverflow question for future reference; and I'm curious if there's some reason for that magic 596523 number.)

    Read the article

  • java.util.Random zero argument enquiry

    - by deerb
    I am trying to code a game following instructions contained in an OU TMA document which read: In the constructor, write code to assign a new instance of Random to ran which you should create using the Random class's zero argument constructor Will this code work? Random ran = new Random(0) ; I am a relative newbie to Java, and I don't understand exactly what the instructions mean

    Read the article

  • How do I mock a method with an open array parameter in PascalMock?

    - by Oliver Giesen
    I'm currently in the process of getting started with unit testing and mocking for good and I stumbled over the following method that I can't seem to fabricate a working mock implementation for: function GetInstance(const AIID: TGUID; out AInstance; const AArgs: array of const; const AContextID: TImplContextID = CID_DEFAULT): Boolean; (TImplContextID is just an alias for Integer) I thought it would have to look something like this: function TImplementationProviderMock.GetInstance( const AIID: TGUID; out AInstance; const AArgs: array of const; const AContextID: TImplContextID): Boolean; begin Result := AddCall('GetInstance') .WithParams([@AIID, AContextID]) .ReturnsOutParams([AInstance]) .ReturnValue; end; But the compiler complains about the .ReturnsOutParams([AInstance]) saying "Bad argument type in variable type array constructor.". Also I haven't found a way to specify the open array parameter AArgs at all. Also, is using the @-notation for the TGUID-typed parameter the right way to go? Is it possible to mock this method with the current version of PascalMock at all? Update: I now realize I got the purpose of ReturnsOutParams completely wrong: It's intended to be used for populating the values to be returned when defining the expectations rather than for mocking the call itself. I now think the correct syntax for mocking the out parameter would probably have to look more like this: function TImplementationProviderMock.GetInstance( const AIID: TGUID; out AInstance; const AArgs: array of const; const AContextID: TImplContextID): Boolean; var lCall: TMockMethod; begin lCall := AddCall('GetInstance').WithParams([@AIID, AContextID]); Pointer(AInstance) := lCall.OutParams[0]; Result := lCall.ReturnValue; end; The questions that remain are how to mock the open array parameter AArgs and whether passing the TGUID argument (i.e. a value type) by address will work out...

    Read the article

  • Passing two arguments to a command using pipes

    - by firebat
    Usually, we only need to pass one argument: echo abc | cat echo abc | cat some_file - echo abc | cat - some_file Is there a way to pass two arguments? Something like {echo abc , echo xyz} | cat cat `echo abc` `echo xyz` I could just store both results in a file first echo abc > file1 echo xyz > file2 cat file1 file2 But then I might accidentally overwrite a file, which is not ok. This is going into a non-interactive script. Basically, I need a way to pass the results of two arbitrary commands to cat without writing to a file. UPDATE: Sorry, the example masks the problem. While { echo abc ; echo xyz ; } | cat does seem to work, the output is due to the echos, not the cat. A better example would be { cut -f2 -d, file1; cut -f1 -d, file2; } | paste -d, which does not work as expected. With file1: a,b c,d file2: 1,2 3,4 Expected output is: b,1 d,3 RESOLVED: Use process substitution: cat <(command1) <(command2) Alternatively, make named pipes using mkfifo: mkfifo temp1 mkfifo temp2 command1 > temp1 & command2 > temp2 & cat temp1 temp2 Less elegant and more verbose, but works fine, as long as you make sure temp1 and temp2 don't exist before hand.

    Read the article

  • Canonical pattern reference in Actors programming model.

    - by Bubba88
    Hello! Is there a source, which I could use to learn some of the most used and popular practices regarding Actor-/Agent-oriented programming. My primary concern is about parallelism and distribution limited to the mentioned scheme - Actors, message passing. Should I begin with Erlang documentation or maybe there is any kind of book that describes the most important building blocks when programming Actor-oriented? Thank you! (Most useful examples would be in Scala or F#)

    Read the article

  • Nginx, proxy passing to Apache, and SSL

    - by Vic
    I have Nginx and Apache set up with Nginx proxy-passing everything to Apache except static resources. I have a server set up for port 80 like so: server { listen 80; server_name *.example1.com *.example2.com; [...] location ~* \.(?:ico|css|js|gif|jpe?g|png|pdf|te?xt)$ { access_log off; expires max; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; add_header Vary: Accept-Encoding; } location / { proxy_pass http://127.0.0.1:8080; include /etc/nginx/conf.d/proxy.conf; } } And since we have multiple ssl sites (with different ssl certificates) I have a server{} block for each of them like so: server { listen 443 ssl; server_name *.example1.com; [...] location ~* \.(?:ico|css|js|gif|jpe?g|png|pdf|te?xt)$ { access_log off; expires max; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; add_header Vary: Accept-Encoding; } location / { proxy_pass https://127.0.0.1:8443; include /etc/nginx/conf.d/proxy.conf; proxy_set_header X-Forwarded-Port 443; proxy_set_header X-Forwarded-Proto https; } } server { listen 443 ssl; server_name *.example2.com; [...] location ~* \.(?:ico|css|js|gif|jpe?g|png|pdf|te?xt)$ { access_log off; expires max; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; add_header Vary: Accept-Encoding; } location / { proxy_pass https://127.0.0.1:8445; include /etc/nginx/conf.d/proxy.conf; proxy_set_header X-Forwarded-Port 443; proxy_set_header X-Forwarded-Proto https; } } First of all, I think there is a very obvious problem here, which is that I'm double-encrypting everything, first at the nginx level and then again by Apache. To make everything worse, I just started using Amazon's Elastic Load Balancer, so I added the certificate to the ELB and now SSL encryption is happening three times. That's gotta be horrible for performance. What is the sane way to handle this? Should I be forwarding https on the ELB - http on nginx - http on apache? Secondly, there is so much duplication above. Is the best method to not repeat myself to put all of the static asset handling in an include file and just include it in the server?

    Read the article

  • BOOST program_options: parsing multiple argument list.

    - by Arman
    Hello, I would like to pass the multiple arguments with positive or negative values. Is it possible to parse it? Currently I have a following initialization: vector<int> IDlist; namespace po = boost::program_options; po::options_description commands("Allowed options"); commands.add_options() ("IDlist",po::value< vector<int> >(&IDlist)->multitoken(), "Which IDs to trace: ex. --IDlist=0 1 200 -2") ("help","print help") ; and I would like to call: ./test_ids.x --IDlist=0 1 200 -2 unknown option -2 So,the program_options assumes that I am passing -2 as an another option. Can I configure the program_options in such a way that it can accept the negative integer values? Thanks Arman.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >