default-value

LEFT JOIN using OR

I was wondering how I would return the result of the left most condition in a OR clause used in a LEFT JOIN if both evaluate to be true. The solutions I've come upon thus far both involve using CASE statement in the SELECT, this does mean I'd abandon the OR clause. The other solution involved using a CASE statement in an ORDER BY. Is ...

Why isn't the default for cflocation addtoken equal to no?

Is there any good reason why the default for this tag would be yes? It seems to be that it should almost always be no. I am missing something? ...

How do I set a default value for a ASPX UserControl property?

I have a user control defined on an page as follows: <uc:MyUserControl ID="MyUserControl" runat="server" Visible="true" /> I am wanting to reuse the same control on a different page with a custom property as follows: <uc:MyUserControl ID="MyUserControl" runat="server" Visible="true" MyCustomProperty="MyCustomText" /> The purpose o...

Is it possible to provide default value for subscripting in Matlab?

In Matlab when one tries to access an element of a matrix that doesn't exist usually an error is raised: >> month(0) ??? Subscript indices must either be real positive integers or logicals. I was wondering whether there is a function that allows supplying default value in such cases. E.g.,: >> get_def(month(0), NaN) ans = NaN P....

named PHP optional arguments ?

Is it possible in PHP 4/5 to specify a named optional parameter when calling, skipping the ones you don't want to specify (like in python) ? Something like: function foo($a,$b='', $c='') { // whatever } foo("hello", $c="bar"); // we want $b as the default, but specify $c Thanks ...

Application-wide control defaults

I'm looking for a way to set up my own default property values for different types of controls in my C# .NET windows application. The default property values should 'override' the existing default values of the controls, but still be 'overridable' by setting the property values explicitly in the designer. This is to simplify the process...

ASP.NET How to set a property to every object of a specific type

Hello, I was wondering if there is a way to set by default the value of an attribute for all specific asp:object As an example: Set the text property for all asp:TextBox objects in the web application to "Please insert text" This example is not what I am trying to achieve, just an example to clarify. Thanks :) ...

Visual basic 6 default property for built in functions

Visual Basic has default properties that are sometimes implicitly called when evaluating an expression. However, I seem to of come across a discrepancy with this implicit execution of default properties. The project layout looks like: Class1: property test -> class2 (default) Class2: property test -> string "hello world" (default) ...

Default Values for JSON in javascript

In the code: slider.init({ foo: "bar" }); var slider={ init:function(data){ } } If I use data.foo, I will get "bar". Supposing I have an optional variable called fish which can be included in the JSON variable. If I reference data.fish, I will be told that it is undefined or an error will be thrown or something. Is there a way th...

Why do I have to assign a value to an int in C# when defaults to 0?

This works: class MyClass { int a; public MyClass() { int b = a; } } But this gives a compiler error ("Use of unassigned local variable 'a'"): class MyClass { public MyClass() { int a; int b = a; } } As far as I can tell this happens because in the first example, technically, the...

OCaml: Default values for function arguments?

In PHP, default values for arguments can be set as follows: function odp(ftw = "OMG!!") { //... } Is there similar functionality in OCaml? ...

Can you declare facultative function arguments in Javascript ?

Like you can in php <?php function whatever($var='') { } ?> can you do that in javascript? ...

MySQL Default Value Issue

Hello All, In MySQL, the default value for a Integer Field is 0. During insertion the value for that field is NULL and the NULL gets inserted. I do some arithmetic manipulation like addition, multipilcation, division using that field's value. This results in error as NULL got inserted. How to resolve this problem? Don't the DB support d...

C default arguments

Is there a way to specify default arguments to a function in C? ...

Default values for COUNT in MySQL

I have a table looking something like this: +-------+-----+ |country|prop1| +-------+-----+ |RO | 1 | |RO | 2 | |UK | 1 | |IT | 2 | +-------+-----+ I want to count the rows for which the prop1 is not null and I use the following select: SELECT `country`, COUNT(*) as number FROM table GROUP BY `country`; this...

Default template parameters arguments in VC++

Does VC++ not support default template parameters arguments? This simple code: template <typename T=int> class X { }; X x; gives me an 'error C2955: 'X' : use of class template requires template argument list'. No complaints about the template declaration, however. What am I missing here? Some compiler switch maybe? ...

Django: How to set initial values for a field in an inline model formset?

I have what I think should be a simple problem. I have an inline model formset, and I'd like to make a select field have a default selected value of the currently logged in user. In the view, I'm using Django's Authentication middleware, so getting the user is a simple matter of accessing request.user. What I haven't been able to fi...

Why does XMLSerializer take DefaultValue Attribute of base class to serialize

using System.ComponentModel; using System.IO; using System.Xml.Serialization; namespace SerializerTest { static class Program { static void Main() { using (TextWriter textWriter = new StreamWriter("data.xml")) { Data data = new Data(); new XmlSerializer(typeof(Data)).Serialize(textWriter, data); textW...

Default Picker Value iphone

Is there a way to set a default value for a picker? I save the last selected row from all the pickers and I want to be able to have the pickers load those saved rows at start up. As of now I have found this code: [settingsPagePicker selectRow:3 inComponent:0 animated:YES]; It works but only when the user taps the picker. I need it ...

Why does ApplicationSettingsBase.Reset() empty the PropertyValues?

I thought the Reset() method repopulates the Settings with default values again, but it seems not to. How can I reload them with the default values? private void buttonLoadDefaultSettings_Click(object sender, EventArgs e) { FooSettings.Default.Reset(); // Data grid will show an empty grid after call to reset. DataGridFoo.R...