tagged [arguments]

Which exception should I raise on bad/illegal argument combinations in Python?

Which exception should I raise on bad/illegal argument combinations in Python? I was wondering about the best practices for indicating invalid argument combinations in Python. I've come across a few s...

2 Nov at 19:26

Pass arguments to running application

Pass arguments to running application I am making an image uploader (upload image to image hosting website) and I'm having some issues passing an argument (image location to an already running applica...

11 Feb at 06:26

Using Default Arguments in a Function

Using Default Arguments in a Function I am confused about default values for PHP functions. Say I have a function like this: What if I want to use the default argument for $x and set a different argum...

24 May at 21:6

Unintuitive behaviour with struct initialization and default arguments

Unintuitive behaviour with struct initialization and default arguments The above gives `valid==true` because the constructor with default arg is NOT called and the ob

How best to determine if an argument is not sent to the JavaScript function

How best to determine if an argument is not sent to the JavaScript function I have now seen 2 methods for determining if an argument has been passed to a JavaScript function. I'm wondering if one meth...

23 May at 12:3

Singleton with parameters

Singleton with parameters I need a singleton class to be instantiated with some arguments. The way I'm doing it now is: ``` class SingletonExample { private SingletonExample mInstance; //other mem...

Passing command-line arguments in C#

Passing command-line arguments in C# I'm trying to pass command-line arguments to a C# application, but I have problem passing something like this even if I add `" "` to the argument. Here is my code:...

14 Oct at 03:37

Escape command line arguments in c#

Escape command line arguments in c# # Short version: Is it enough to wrap the argument in quotes and escape `\` and `"` ? # Code version I want to pass the command line arguments `string[] args` to an...

20 Jun at 09:12

What's the difference between an argument and a parameter?

What's the difference between an argument and a parameter? When verbally talking about methods, I'm never sure whether to use the word or or something else. Either way the other people know what I mea...

Can you explain me this strange behaviour of c# with optional arguments?

Can you explain me this strange behaviour of c# with optional arguments? > [C# optional parameters on overridden methods](https://stackoverflow.com/questions/8909811/c-sharp-optional-parameters-on-ov...

23 May at 10:34

Command Line Parser with mutually exclusive required parameters

Command Line Parser with mutually exclusive required parameters I started to use the [CommandLine Parser Library](http://commandline.codeplex.com) for a tool that will have both a GUI and a command li...

commandline argument parameter limitation

commandline argument parameter limitation Language: C# I have to pass a huge string array (built dynamically) as an argument to run an exe. I am thinking of acheiving it by the below 2 ways. But I am ...

How can I process command line arguments in Python?

How can I process command line arguments in Python? What would be an easy expression to process command line arguments if I'm expecting anything like 001 or 999 (let's limit expectations to 001...999 ...

Java stack overflow error - how to increase the stack size in Eclipse?

Java stack overflow error - how to increase the stack size in Eclipse? I am running a program that I've written in Java in Eclipse. The program has a very deep level of recursion for very large inputs...

What is the best way to pass a stream around

What is the best way to pass a stream around I have tried to pass stream as an argument but I am not sure which way is "the best" so would like to hear your opinion / suggestions to my code sample I p...

21 Oct at 18:29

Is there a way to get an array of the arguments passed to a method?

Is there a way to get an array of the arguments passed to a method? Say I have a method: Is there a way to retrieve an array of the arguments passed into the method, so that they can be logged? I have...

20 Jul at 10:53

How to enforce required command-line options with NDesk.Options?

How to enforce required command-line options with NDesk.Options? I was just writing a console utility and decided to use NDesk.Options for command-line parsing. My question is, How do I enforce requir...

How do I define a function with optional arguments?

How do I define a function with optional arguments? I have a Python function which takes several arguments. Some of these arguments could be omitted in some scenarios. The arguments `d` through `h` ar...

In C#, should one check references passed to methods against null?

In C#, should one check references passed to methods against null? Well, a few months ago I asked [a similar question about C and C++](https://stackoverflow.com/questions/4390007/in-either-c-or-c-shou...

Transform hexadecimal information to binary using a Linux command

Transform hexadecimal information to binary using a Linux command I have this binary file on my Linux system... ``` udit@udit-Dabba ~ $ cat file.enc Salted__s�bO��

How can I resolve "The argument type 'String' can't be assigned to the parameter type 'int' " - Flutter

How can I resolve "The argument type 'String' can't be assigned to the parameter type 'int' " - Flutter I'm trying to fetch data Online Using HTTP GET with Flutter SDK. I'm trying with this code [http...

12 Feb at 03:1

Where to perform argument validation in JavaScript?

Where to perform argument validation in JavaScript? Yeah, read properly. In the last time I saw different patterns of argument validation in JavaScript (functions) and wondered which of them would be ...

Why does C# allow ambiguous function calls through optional arguments?

Why does C# allow ambiguous function calls through optional arguments? I came across this today, and I am surprised that I haven't noticed it before. Given a simple C# program similar to the following...

C# Process Start needs Arguments with double quotes - they disappear

C# Process Start needs Arguments with double quotes - they disappear I'm trying to run a cmd line application from c# using Process.Start(ProcessStartInfo); The problem is, the cmd line application is...

Canonical solution for escaping .NET command line arguments

Canonical solution for escaping .NET command line arguments : Given a file name and an arbitrary list of strings, is there a to create a single command line such that [Environment.GetCommandLineArgs](...

23 May at 12:24