default-value

Sourcesafe command line options

假如想象 提交于 2019-12-03 13:38:32
I am having an issue with the Microsoft Visual Sourcesafe command line options that I'm hoping someone has run across and can assist me with. I have the following line in a DOS batch file. "c:\Program Files\Microsoft Visual SourceSafe\ss.exe" GET "$/Development Projects/Activity" -GL"C:\Compile\Activity" -R -Q -Yname,password When this line is executed in the batch file the following prompt appears ... Set C:\Compile\Activity as the default folder for project $/Development Projects/Activity?(Y/N) I need to suppress this prompt in order to let the script run unattended. I thought the -Q option

How does one have the C# designer know the default property for a Padding or other object/struct in C#

徘徊边缘 提交于 2019-12-03 12:51:07
How does one tell the designer the default value of a Property when it is not one of the types supported by DefaultValue() ? For instance, a Padding , or a Font . Normally, when you use a Windows Forms control, the default values will be in a normal font in the Properties window, and changed (non-default) values will be in bold. E.g. In this sample, the default value of ShowAddress is false and the default value of ShowName is true . This effect is achieved with the following: [DefaultValue(false)] public bool ShowAddress { get { return mShowAddress; } set { mShowAddress = value; Invalidate();

Setting the default value of a function input to equal another input in Python

喜你入骨 提交于 2019-12-03 11:04:07
问题 Consider the following function, which does not work in Python, but I will use to explain what I need to do. def exampleFunction(a, b, c = a): ...function body... That is I want to assign to variable c the same value that variable a would take, unless an alternative value is specified. The above code does not work in python. Is there a way to do this? Thank you. 回答1: def example(a, b, c=None): if c is None: c = a ... The default value for the keyword argument can't be a variable (if it is, it

How to set default value for Auto-Implemented Properties in ASP.NET [duplicate]

泪湿孤枕 提交于 2019-12-03 09:34:36
This question already has answers here : What is the best way to give a C# auto-property an initial value? (21 answers) I came to know that C# 3.0 comes with a new feature of Auto-Implemented Properties,I liked it as we don't have to declare extra private varible in this (compare to earlier property), earlier I was using a Property i.e. private bool isPopup = true; public bool IsPopup { get { return isPopup; } set { isPopup = value; } } Now I've converted it into Auto-Implemented property i.e. public bool IsPopup { get; set; } I want to set the default value of this property to true without

React - change input defaultValue by passing props

隐身守侯 提交于 2019-12-03 08:32:11
问题 Consider this example: var Field = React.createClass({ render: function () { // never renders new value... return ( <div> <input type="text" defaultValue={this.props.value || ''} /> </div> ); } }); var App = React.createClass({ getInitialState: function () { return {value: 'Hello!'}; }, changeTo: function (str) { this.setState({value: str}); }, render: function () { return ( <div> <Field value={this.state.value} /> <button onClick={this.changeTo.bind(null, 'Whyyyy?')}>Change to "Whyyyy?"<

Objective-C set default value for a property

我们两清 提交于 2019-12-03 08:15:03
问题 I'm making an app, and I have a class with quite a lot properties and I was wondering if it was possible to give them a default value. Because if I make an init method, it's a lot of work to type everything, there's a big chance of typo's and it's just not nice coding... This is how my class looks like: // Goalkeeping attributes @property (nonatomic) int aerialAbility; @property (nonatomic) int commandOfArea; @property (nonatomic) int communication; @property (nonatomic) int eccentricity;

Can I specify a default Color parameter in C# 4.0?

末鹿安然 提交于 2019-12-03 05:50:24
Here is an example function: public void DrawSquare(int x, int y, Color boxColor = Color.Black) { //Code to draw the square goes here } The compiler keeps giving me the error: Default parameter value for 'boxColor'must be a compile-time constant I have tried Color.Black, Color.FromKnownColor(KnownColor.Black), and Color.FromArgb(0, 0, 0) How do I make Color.Black be the default color? Also, I do not want to use a string Black to specify it (which I know would work). I want the Color.Black value. Color.Black is a static, not a constant, so no, you cannot do this. To use a default, you can make

Scala: how to initialize an object using default values

梦想与她 提交于 2019-12-03 05:31:53
I think this will be better explained with an example I have the following case class case class Person(name: String = "no name", surname: String = "no surname") And I want to make a general function to populate it from, for example, a json message, that might not specify all fields I know that to use the default values the simple answer is not to pass them to the constructor, but if I have several fields that may or may not appear in the json, I should have to use a huge switch sentence covering every possible combination of missing parameters. In this case, after reading the json, I should

MySQL - Set default value for field as a string concatenation function

风流意气都作罢 提交于 2019-12-03 03:36:25
I have a table that looks a bit like this actors(forename, surname, stage_name); I want to update stage_name to have a default value of forename." ".surname So that insert into actors(forename, surname) values ('Stack', 'Overflow'); would produce the record 'Stack' 'Overflow' 'Stack Overflow' Is this possible? Thanks :) MySQL does not support computed columns or expressions in the DEFAULT option of a column definition. You can do this in a trigger (MySQL 5.0 or greater required): CREATE TRIGGER format_stage_name BEFORE INSERT ON actors FOR EACH ROW BEGIN SET NEW.stage_name = CONCAT(NEW

How to define default null value in application.yml in Spring Boot

回眸只為那壹抹淺笑 提交于 2019-12-03 02:55:49
I'm trying to define the default value as null value in application.yml with SpringBoot version 1.3.0.RELEASE. The goal is be able to refer it with a class with ConfigurationProperties annotation -- application.yml -- test.foo: ${test.bar:#{null}} but it doesn't work. If the value of test.bar is not defined, set test.foo to null (default value) I already have spring-el in my dependencies. I don't want to use PropertyPlaceholderConfigurer.setNullValue It's seem to work in @Value but not in application.yml (see http://farenda.com/spring/spring-inject-null-value/ ) It's a bug, or yaml is not