Search Results

Search found 5279 results on 212 pages for 'optional arguments'.

Page 8/212 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • alias/function with command line arguments

    - by Agzam
    I'm tired of typing manage.py startserver 10.211.55.4:4000, so decided to make an alias for that. Only thing is: the port sometime changes. So I did this in bash profile: function runserver() { python manage.py runserver 10.211.55.4:$1 } But then when I call it: runserver 3000, it starts it, but immediately stops saying: "Error: That IP address can't be assigned-to". However if I type the same thing right into command line it works with no complains.

    Read the article

  • Directory structure and script arguments

    - by felwithe
    I'll often see a URL that looks something like this: site.com/articles/may/05/02/2011/article-name.php Surely all of those subdirectories don't actually exist? It seems like it would be a huge redundancy, even if it was only an identical index file in every directory. To change anything you'd have to change every single one. I guess my question is, is there some more elegant way that sites usually accomplish this?

    Read the article

  • Optional one-to-one mapping in Hibernate

    - by hibernate
    How do I create an optional one-to-one mapping in the hibernate hbm file? For example, suppose that I have a User and a last_visited_page table. The user may or may not have a last_visited page. Here is my current one-to-one mapping in the hbm file: User Class: <one-to-one name="lastVisitedPage" class="LastVisitedPage" cascade="save-update"> LastVisitedPage Class: <one-to-one name="user" class="user" constrained="true" /> The above example does not allow the creation of a user who does not have a last visited page. A freshly created user has not visited any pages yet. How do I change the hbm mapping to make the userPrefs mapping optional?

    Read the article

  • Django Formset validation with an optional ForeignKey field

    - by Camilo Díaz
    Having a ModelFormSet built with modelformset_factory and using a model with an optional ForeignKey, how can I make empty (null) associations to validate on that form? Here is a sample code: ### model class Prueba(models.Model): cliente = models.ForeignKey(Cliente, null = True) valor = models.CharField(max_length = 20) ### view def test(request): PruebaFormSet = modelformset_factory(model = Prueba, extra = 1) if request.method == 'GET': formset = PruebaFormSet() return render_to_response('tpls/test.html', {'formset' : formset}, context_instance = RequestContext(request)) else: formset = PruebaFormSet(request.POST) # dumb tests, just to know if validating if formset.is_valid(): return HttpResponse('0') else: return HttpResponse('1') In my template, i'm just calling the {{ form.cliente }} method which renders the combo field, however, I want to be able to choose an empty (labeled "------") value, as the FK is optional... but when the form gets submitted it doesn't validate. Is this normal behaviour? How can i make this field to skip required validation?

    Read the article

  • What's the difference between arguments with default values and keyword-arguments?

    - by o_O Tync
    In Python, what's the difference between arguments having default values: def f(a,b,c=1,d=2): pass and keyword arguments: def f(a=1,b=2,c=3): pass ? I guess there's no difference, but the tutorial has two sections: 4.7.1. Default Argument Values 4.7.2. Keyword Arguments which sounds like there are some difference in them. If so, why can't I use this syntax in 2.6: def pyobj_path(*objs, as_list=False): pass ?

    Read the article

  • Limit on number of kernel arguments in OpenCL

    - by Rakesh K
    Hi, I wanted to know if there is any limit on the number of arguments that are set to kernel function in OpenCL. I am getting the error as INVALID_ARG_INDEX while setting arguments. I am setting 9 arguments in the kernel function. Please help me in this regard. Thanks, Rakesh.

    Read the article

  • Accessing Arguments, Workflow Variables from custom activities

    - by yang
    I have a workflow composed of many custom activities. All these activities need to access startup arguments of the workflow itself. I can define InArgument inside all these custom activities and bind the workflow arguments to custom activity arguments but I am not comfortable with this solution. What is the best way to access workflow level argument and variable declarations from custom activities. Can I get them from ActivityContext? Thanks.

    Read the article

  • Javascript: Pass array as optional method args

    - by Dave Paroulek
    console.log takes a string and replaces tokens with values, for example: console.log("My name is %s, and I like %", 'Dave', 'Javascript') would print: My name is Dave, and I like Javascript I'd like to wrap this inside a method like so: function log(msg, values) { if(config.log == true){ console.log(msg, values); } } The 'values' arg might be a single value or several optional args. How can I accomplish this? If I call it like so: log("My name is %s, and I like %s", "Dave", "Javascript"); I get this (it doesn't recognize "Javascript" as a 3rd argument): My name is Dave, and I like %s If I call this: log("My name is %s, and I like %s", ["Dave", "Javascript"]); then it treats the second arg as an array (it doesn't expand to multiple args). What trick am I missing to get it to expand the optional args?

    Read the article

  • .Net SvcUtil: attributes must be optional

    - by Michel van Engelen
    Hi, I'm trying to generate C# code classes with SvcUtil.exe instead of Xsd.exe. The latter is giving me some problems. Command line: SvcUtil.exe myschema.xsd /dconly /ser:XmlSerializer Several SvcUtil problems are described and solved here: http://blog.shutupandcode.net/?p=761 One problem I can't solve is this one: Error: Type 'DatafieldDescription' in namespace '' cannot be imported. Attributes must be optional and from namespace 'http://schemas.microsoft.com/2003/10/Seri alization/'. Either change the schema so that the types can map to data contract types or use ImportXmlType or use a different serializer. ' I changed <xs:attribute name="Order" use="required"> to <xs:attribute name="Order" use="optional"> and <xs:attribute name="Order"> But the error remains. Is it possible to use attributes, or do I have to delete them all (in that case, this excercition is over)?

    Read the article

  • How do i configure optional flags in MVC 1.0 routes

    - by Thomas Jespersen
    I want to configure a route with optional flags. E.g. I want to be able to call the products page and send optional filters (flags) for offers and in stock options. If the flags are NOT specified then all products should be returned. http://localhost/products http://localhost/products/onlyOnOffer http://localhost/products/onlyInStock http://localhost/products/onlyInStock/onlyOnOffer [AcceptVerbs(HttpVerbs.Get)] public ActionResult GetProducts(bool onlyInStock, bool onlyOnOffer) { //... } How would I configure the route? Is it even possible in MVC 1.0? What about MVC 2.0.

    Read the article

  • How to pass arguments to Go program?

    - by oraz
    I can't see arguments for main() in package main. How to pass arguments from command line in Go? A complete program, possibly created by linking multiple packages, must have one package called main, with a function func main() { ... } defined. The function main.main() takes no arguments and returns no value.

    Read the article

  • velocity: join optional fields with a separator/prefix

    - by SlowStrider
    What would be the most concise/readable way in a velocity template to join multiple fields with a separator while leaving out empty or null Strings without adding excess separators? As an example we have a tooltip or appointments that goes like: Appointment ($number) [with $employee] [-] [$remarks] [-] [$roomToVisit] Where I used brackets to indicate optional data. When filled in it would normally show as Appointment (3) with John - ballroom - serve Java coffee When $remarks is empty but $roomToVisit is not, this becomes: Appointment (3) with John - ballroom When $remarks is "serve Java coffee" but $roomToVisit is empty we get: Appointment (3) with John - serve Java coffee When both are empty: Appointment (3) with John Bonus: also make the field prefix optional. When only $employee is empty we should get: Appointment (2) serve Java coffee - ballroom Ideally I would like the velocity template to look very similar to the first code box. If this is not possible, how would you achieve this with a minimum of distracting code tags? Similar ideas (first is much more verbose): Join with intelligent separators velocity: do something except in last loop iteration

    Read the article

  • How to print arguments passed to configure script?

    - by Sam
    Hi, I'm trying to print arguments passed to a ./configure script. Calling 'echo' on $BASH_ARGV will just print the last set of arguments. For example if I run: ./configure --enable-foo --enable-bar echo $BASH_ARGV will print only "--enable-bar" How do I print all the arguments? Thanks!

    Read the article

  • Obtaining command line arguments in a QT application

    - by morpheous
    The following snippet is from a little app I wrote using the QT framework. The idea is that the app can be run in batch mode (i.e. called by a script) or can be run interactively. It is important therefore, that I am able to parse command line arguments in order to know which mode in which to run etc. [Edit] I am debugging using QTCreator 1.3.1 on Ubuntu Karmic. The arguments are passed in the normal way (i.e. by adding them via the 'Project' settings in the QTCreator IDE). When I run the app, it appears that the arguments are not being passed to the application. The code below, is a snippet of my main() function. int main(int argc, char *argv[]) { //Q_INIT_RESOURCE(application); try { QApplication the_app(argc, argv); //trying to get the arguments into a list QStringList cmdline_args = QCoreApplication::arguments(); // Code continues ... } catch (const MyCustomException &e) { return 1; } return 0; } [Update] I have identified the problem - for some reason, although argc is correct, the elements of argv are empty strings. I put this little code snippet to print out the argv items - and was horrified to see that they were all empty. for (int i=0; i< argc; i++){ std::string s(argv[i]); //required so I can see the damn variable in the debugger std::cout << s << std::endl; } Does anyone know what on earth is going on (or a hammer)?

    Read the article

  • Strange errors in Visual C++ :: 'malloc' : function does not take 1 arguments

    - by pecker
    Error 38 error C2660: 'malloc' : function does not take 1 arguments C:\VolumeRenderer\render.cpp 296 1 VolumeRenderer Error 39 error C2660: 'malloc' : function does not take 1 arguments C:\VolumeRenderer\render.cpp 412 1 VolumeRenderer Error 40 error C2660: 'malloc' : function does not take 1 arguments C:\VolumeRenderer\render.cpp 414 1 VolumeRenderer Error 41 error C2660: 'read_den' : function does not take 4 arguments C:\VolumeRenderer\render.cpp 506 1 VolumeRenderer My all malloc sections are like this: /* allocate space for the raw data */ density_size = BRAIN_XLEN * BRAIN_YLEN * BRAIN_ZLEN; density = (unsigned char*)malloc(density_size); if (density == NULL) { fprintf(stderr, "out of memory\n"); exit(1); } regarding read_den (last error) unsigned char *read_den(char *filename,int *xptr,int *yptr,int *zptr)// function prototype src_volume = read_den(src_file, &src_xlen, &src_ylen, &src_zlen);// fucntion call Is it my code or the errors that are absurd. How to rectify them?

    Read the article

  • Windows service - supplying arguments in "path to executable"

    - by Jono
    I cannot figure out how to pass (constant) arguments into my Windows service when it is started. I'm using the standard .NET classes like ServiceBase to implement (and ServiceProcessInstaller and ServiceInstaller to install) my service. On the general tab of a Windows Service properties dialog box (once installed), there's a "Path to executable" in which I can see that some of the standard Windows services have command line arguments specified. System.ServiceProcess.ServiceBase.OnStart takes string[] args, which I presume would enable these arguments to be accessed from within .NET code. Are there some properties on ServiceProcessInstaller or ServiceInstaller that I can set to allow me to pass startup arguments to my own service, or does anyone know how it's supposed to be done?

    Read the article

  • OpenVPN make redirect-gateway optional

    - by Tuinslak
    Hi there, I'm currently running an OpenVPN server for multiple clients. All traffic is directed through the VPN (it's set up as gateway; push "redirect-gateway def1"). So far, all is working fine. However, I'd like to connect a couple of servers to this virtual private network, without these servers using the OVPN daemon as gateway. These servers have to be accessible from both their WAN as well as their LAN IP address. Certain services will be accessible only from the LAN side. Is there any way, for a client, to ignore the push redirect-gateway option? Kind regards, Tuinslak

    Read the article

  • Safari, IIS and optional Client Certificates

    - by Philipp
    I've a ASP.Net Webapp running on IIS7.5. The Webserver is configured to accept Client Certifcates. Unfortunately Visitors with Safari Browser are unable to view the Page. Same Problem as described under the following link: http://www.mnxsolutions.com/apache/safari-providing-an-ssl-error-client-certificate-rejected%E2%80%9D-when-other-browsers-work.html Does anyone knows how to solve this? I'd really appreciate your help. edit: Seems to be the same problem: http://superuser.com/questions/231695/iis7-5-ssl-question-safari-users-get-a-prompt-of-certificate-to-select

    Read the article

  • file:// command-line arguments

    - by Cory Grimster
    Is it possible to pass command-line arguments to a program that is invoked via a file:// url? I'm trying to include Remote Desktop links in a wiki page that lists some servers: <a href="file:///c|/windows/system32/mstsc.exe /v:serverName">serverName</a> When I omit the argument the link works fine, but when I include it the link doesn't work. I Googled around a bit and couldn't find any references to this. I suspect that the answer is that file:// urls simple don't accept arguments (I can think of all kinds of ways to abuse them if they do), but I thought I'd throw it out there in case I've simply got the syntax wrong. Thanks.

    Read the article

  • In Excel format number with optional decimal places

    - by Ray
    Simple: I have numbers in cells in excel. I want the numbers formatted so that if they have decimal places they show to a maximum of 2DP and if they have no decimal places it doesn't show any. For example. 15 should be formatted as 15 NOT 15.00 14.3453453 should be formatted as 14.35 12.1 should be formatted as 12.1 0 should be formatted as 0 The closest custom format code I've come up with is 0.##. Unfortunately this formats 15.00 as 15. (note the extra decimal place). Edit: To further complicate the issues, the spreadsheet is a result of an export from SQL Server Reporting Services. So no macros are possible. Oh well, it looks like 0.## is my best bet, and they can just live with the extra period.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >