All Questions
Tagged with option-type parameters
56
questions
0
votes
0
answers
47
views
How to create working powershell module with optional flags
I have a function that I am trying to make unto a module to use in my daily sripts. I want it to work kind of like (writeI -host "hello" -fore red -back black" where it has flags and ...
1
vote
1
answer
109
views
Roslyn: generate method optional parameters from reflected interface
Given SomeInterfaceType that has a method with optional parameters:
interface SomeInterface
{
void SomeMethod(int a = 1, string c = "foo",
SomeType e = default, ...
0
votes
0
answers
59
views
Multiple Optional Parameters in SQL, how to make all results appear
I'm working on a query that would allow for four optional parameters. Any of them could be filled out or none of them. My issue is, when one of the parameters is blank within my SQL, it doesn't appear ...
1
vote
3
answers
47
views
How to pass specified parameters in Javascript
I would like to pass value to specified parameters and use default value by optional parameters for the rest.
A sample is made as below.
Current result is 'b23'.
But I would like to obtain the result ...
-2
votes
2
answers
639
views
Error while decoding an optional parameter on Swift
Trying to decode a server response. It contains an optional parameters, like below
struct name {
let id: String
let name: String?
}
extension OrganizationV1: Decodable {
enum ...
1
vote
2
answers
399
views
C# method second parameter optional
I am a newbie for C#.
current incomplete code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace classObjectMethodBasic
{
...
2
votes
2
answers
258
views
What is the cleanest way in swift to use an optional in a function parameter when nil should return a specific default value?
I need to unwrap the optional and use it as a parameter to the function. If the optional is nil, then I need to default to a specific value.
Is there a shorter/cleaner way to code this example?
...
-1
votes
1
answer
76
views
optional SSRS parameter
I have an optional string parameter @PString and an optional integer parameter @PInt and have the it set up to allow nulls. Can someone help me with the syntax in the "where" clause to consider that ...
1
vote
1
answer
1k
views
None required PathVariable not working
I got the following code:
@GetMapping(value = "/user/{username}/{auth_key}", produces = MediaType.APPLICATION_JSON_VALUE)
public ProfileRequest getUser(final @PathVariable("username") String username,...
1
vote
1
answer
54
views
Swift: Is there any difference in defining a function parameter with '!'
I sometimes see a function which accepts an object as a parameter which has '!' as suffix.
I know it means the parameter is an implicitly unwrapped optional.
But I don't know what is the difference ...
3
votes
1
answer
701
views
F# - Same Function With Different Parameters
In F#, is it possible for a function to take one required parameter and one or more optional parametes depending on context? In the following toy example, whisk initially takes eggYolks as its only ...
1
vote
0
answers
295
views
angular router with optional params doesn't navigate
I am using angular 2.4 and I am trying to navigate from the route :
{route:'/heroes',HeroesComponent}
to the same route but with passing optional params via:
this.router.navigate(['/heroes',{name:...
0
votes
2
answers
650
views
how to pass optional parameters into a function in python?
I have a function which I want to pass two optional parameters. I have read through but somehow I am not able to make it work though.
What am I missing here?
I have something like this
def ...
0
votes
1
answer
54
views
How to implement optional positional parameter in Python
I have a Python 2.7 script returns some data. It also takes command line positional parameters:
filename.py -ip 172.17.12.12 -username admin
So far I have 4 parameters have been calculated with the ...
1
vote
1
answer
1k
views
Rewrite URL with Optional Parameter
I've got this url
category/product/index.php?itemid=WdS7Dk3L&title=new-product
I'd like to rewrite it to this and where second parameter is optional
category/product/WdS7Dk3L/new-product
or
...