Questions tagged [default]

Refers to an initial, most commonly used option, setting, or value that is automatically assigned to an application or device, outside of user intervention, with the intention of making it usable "out of the box".

A , in computer science, refers to a setting or a value automatically assigned to a software application, computer program or device, outside of user intervention. Such settings are also called presets, especially for electronic devices. Default values are generally intended to make a device (or control) usable "out of the box". A common setting, or at least a usable setting, is typically assigned.

tag should be used for questions regarding

  • Default features of programming languages (like default return type of C functions).
  • Default configuration of and Applications.

SOURCE

Wikipedia

3506 questions
89
votes
2 answers

What is the equivalent in F# of the C# default keyword?

I'm looking for the equivalent of C# default keyword, e.g: public T GetNext() { T temp = default(T); ... Thanks
elmattic
  • 12,046
  • 5
  • 43
  • 79
88
votes
6 answers

Reset par to the default values at startup

Normally when I make my own plot functions, I make a construct : op <- par("mypar"=myvalue) on.exit(par(op)) which is the standard way of reverting the par to the previous values. Imagine you've been running some functions that did change some of…
Joris Meys
  • 106,551
  • 31
  • 221
  • 263
88
votes
5 answers

How do I change the default index page in Apache?

I would like to change the default web page that shows up when I browse my site. I currently have a reporting program running, and it outputs a file called index.html. I cannot change what it calls the file. Therefore, my landing page must be called…
Tyler Montney
  • 1,402
  • 1
  • 17
  • 25
87
votes
11 answers

Linux: command to open URL in default browser

What command we have to execute (from Java, but that should not matter) on Linux (different common distributions) to open a given URL in the default browser?
Mot
  • 28,248
  • 23
  • 84
  • 121
86
votes
6 answers

PHP sessions default timeout

Do PHP sessions timeout by default - ie without any coding on my part would a user eventually be "logged out" after some time of inactivity?
KB.
  • 3,549
  • 4
  • 23
  • 29
85
votes
9 answers

How to set the default to unfolded when you open a file?

In my .vimrc I've put set foldmethod=syntax to enable folding of methods etc. However, I don't like the default that everytime I open a file, the whole thing is folded. Is there a way to enable foldmethod, yet have files unfolded when I open them?
Suan
  • 34,563
  • 13
  • 47
  • 61
79
votes
3 answers

What is an iterator's default value?

For any STL container that I'm using, if I declare an iterator (of this particular container type) using the iterator's default constructor, what will the iterator be initialised to? For example, I have: std::list
The Void
  • 857
  • 2
  • 7
  • 6
75
votes
8 answers

Pros and cons of package private classes in Java?

I am learning Java recently, and I came across the notion of package-private classes, which is the default if we don't specify anything. But then I realized: I seldom see the use of package-private class. Is there a reason for this, e.g., it has…
zw324
  • 26,764
  • 16
  • 85
  • 118
72
votes
6 answers

How do you drop a default value or similar constraint in T-SQL?

I know the syntax: ALTER TABLE [TheTable] DROP CONSTRAINT [TheDefaultConstraint] but how to I drop the default constraint when I don't know its name? (That is, it was autogenerated at CREATE TABLE time.)
Frank Krueger
  • 69,552
  • 46
  • 163
  • 208
69
votes
12 answers

Symfony2 Setting a default choice field selection

I am creating a form in the following manner: $form = $this->createFormBuilder($breed) ->add('species', 'entity', array( 'class' => 'BFPEduBundle:Item', 'property' => 'name', …
Matt G
  • 1,332
  • 2
  • 13
  • 25
61
votes
4 answers

Using an attribute of the current class instance as a default value for method's parameter

Possible Duplicate: default value of parameter as result of instance method While it is possible to set default values to function parameters in python: def my_function(param_one='default') ... It seems not to be possible to access the…
paweloque
  • 18,466
  • 26
  • 80
  • 136
60
votes
4 answers

How to use a member variable as a default argument in C++?

I want to make an argument for one of the member functions optional. When no argument is provided, it would use an member variable. However, when I tried to compile it it shows error: invalid use of non-static data member 'Object::initPos' Just to…
tuzzer
  • 1,119
  • 3
  • 12
  • 20
60
votes
6 answers

Default action to execute when pressing enter in a form

I've got a jsf 1.2 form with two buttons and several input fields. The first button discards the entered values and repopulates the page with values from a db, the second button saves the entered values. The problem occurs when the user presses…
Jörn Horstmann
  • 33,639
  • 11
  • 75
  • 118
59
votes
7 answers

How can I return a default value for an attribute?

I have an object myobject, which might return None. If it returns None, it won't return an attribute id: a = myobject.id So when myobject is None, the stament above results in a AttributeError: AttributeError: 'NoneType' object has no attribute…
alwbtc
  • 28,057
  • 62
  • 134
  • 188
57
votes
8 answers

Why is default required for a switch on an enum?

Normally, default is not necessary in a switch statement. However, in the following situation the code successfully compiles only when I uncomment the default statement. Can anybody explain why? public enum XYZ {A,B}; public static String…
apoorv020
  • 5,420
  • 11
  • 40
  • 63