default

How do I use a table other than "Users" for CakePHP's AuthController?

CakePHP's AuthController assumes you have a Users table that contains a username and password. I'd like to find a way to override the default tablename from Users to Accounts. Background Information: The way I have designed my database is to have a Users table and an Accounts table. Accounts : id user_id username password authentica...

Set .ashx as start "page" for web application

Is it possible to set an .ashx file as the starting (or default) page for a web application? If so, how is it done? Edit - Some good suggestions. I have added "Default.ashx" to the IIS Default Documents and "Enabled Default Document" on the website, however, it only displays a directory listing even though I have disabled directory br...

C++ Classes default constructor

Earlier I asked why this is considered bad: class Example { public: Example(void); ~Example(void); void f() {} } int main(void) { Example ex(); // <<<<<< what is it called to call it like this? return(0); } Now, I understand that it's creating a function prototype instead that returns a type Example. I still don't get why ...

SQL Server Compare field value with its default

I need to iterate through the fields on a table and do something if its value does not equal its default value. I'm in a trigger and so I know the table name. I then loop through each of the fields using this loop: select @field = 0, @maxfield = max(ORDINAL_POSITION) from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = @TableName while ...

[PHP] Multiple Seperate Switch Statements

Hi :) I have multiple switch statements in on one of the pages in order to pass different vsriables to the URL, as well as different case. I need these different switch statements because I need the different variables. However, when I put a "default" in one of the switch statements, that default applies to every other switch statement...

Default Windows Languages?

Hi. Is there some default Windows scripting language that comes pre-installed on XP and Vista (Similar to how OS X comes with Python and/or Linux comes with Perl)? I am aware of Batch scripting but I am hoping for something a little more robust. Thanks note - I am on a Linux box so if you guys could give your 2 cents on the Window...

ASP.net: Changing Default webcontrol properties

Good day, In visual studio 2005, when I drop a webcontrol in the designer, I have to manually set the CssClass property. Is there a way to automatically set that property? The thing is, 90% of the time, I want to apply a css to my controls, but not always, so I cannot really use css style in html head. I thought about creating my own us...

What for should I mark private variables as private if they already are?

Hello. As far as I know, in C# all fields are private for default, if not marked otherwise. class Foo { private string bar; } class Foo { string bar; } I guess these two declarations are equal. So my question is: what for should I mark private variables as private if they already are private? ...

default value of a variable at the time of declaration in C# and VB ??

Can anybody tell me what is the default value of a variable at the time of declaration in C# and vb?? ...

Is overloading really the only way to get default values for method parameters in Java?

I'm quite new to Java and from Python and PHP, I'm used to default values for function parameters. So I have a habit of writing methods that are designed to be called from slightly different situations where you want to set only some of the values. For example, in my PHP code, this would be common where I have factory methods that provi...

[WPF/C#] Default ValueConverter for a class in WPF

Hi Girls and Guys! I'm just about to start a new project of mine and am currently evaluating some techniques for localization, modularity etc. I have (at least in my opinion) a pretty good approach to localization but now I struggle to find a good solution for databinding. I want to bind values of textfields etc. (UIElements in genera...

Are default parameters bad practice in OOP?

Do default parameters for methods violate Encapsulation? What was the rationale behind not providing default parameters in C#? ...

How can "default" values in overridden WinForm controls be prevented?

I'm trying to learn and grasp what and how C# does things. I'm historically a Visual Foxpro (VFP) developer, and somewhat spoiled at the years of visual inheritance by creating my own baseline of user controls to be used application wide. In trying to learn the parallels in C#, I am stuck on something. Say I derive my own label contro...

best way make default param = a variable?

I have a variable, and a function for brevity lets consider it looks like this: private function applyDiscount (value:Number):Number { return value*_discount; //_discount defined somewhere else } OK thats all fine and dandy but say I want to be able to call that function and be able to pass my own discount, but still use the _discount...

Default using directives in new C# files

Why does Visual Studio 2008 automatically insert the following using directives into each new C# file I create? using System; using System.Collections.Generic; using System.Text; What's so special about these namespaces? Are these the most frequently used ones? ...

ALTER TABLE with programmatically determined constant DEFAULT value

I am trying to add a column (MSSQL 2005) to a table (Employee) with a default constraint of a primary key of another table (Department). Then I am going to make this column a FK to that table. Essentially this will assign new employees to a base department based off the department name if no DepartmentID is provided. This does not work...

How do you assign a column default in MySQL to another column's value?

I want to add a new column to a table in MySQL database that should get the value of another column in the same table. Is this possible? If so, how do you do it? Thanks! ...

What is the meaning of the default build qualities provided by TFS?

There is this set of default build qualities: Initial Test Passed Lab Test Passed Ready for Deployment Ready for Initial Test Rejected Released UAT Passed Under Investigation I'm not really sure about the meaning of each entry. I lack experience in this area (and additionally, i'm not a native speaker). Is there an explanation of the...

Is there a reasonable approach to "default" type parameters in C# Generics?

In C++ templates, one can specify that a certain type parameter is a default. I.e. unless explicitly specified, it will use type T. Can this be done or approximated in C#? I'm looking for something like: public class MyTemplate<T1, T2=string> {} So that an instance of the type that doesn't explicitly specify T2: MyTemplate<int> t ...

Specify a default empty DataTemplate instead of the default 'ToString()' DataTemplate

Hi, The default DataTemplate in a wpf application displays the result of the .ToString() method. I'm developing an application where the default DataTemplate should display nothing. I've tried: <Grid.Resources> <DataTemplate DataType="{x:Type System:Object}"> <Grid></Grid> </DataTemplate> </Grid.Resources> But this doesn't w...