default

How to alter the default value set to a column in a table in SQL?

How can you alter the default value set to a column in a table in SQL. I got an error from: ALTER TABLE tablename.tab ALTER COLUMN mess1 DEFAULT ('hi') What was the correct query? ...

Class based default value for field in Django model inheritance hierarchy

How can one accomplish class-based default value in following scheme? I mean, I would like to inherited classes set default value for "number" differently: class OrderDocumentBase(PdfPrintable): number = models.PositiveIntegerField(default=self.create_number()) @classmethod def create_number(cls): raise NotImplement...

Set Default Chooser when Selecting Image?

Hello, In my application the user selects an image. When the ACTION_GET_CONTENT intent is launched it displays the dialog to select one of the available image viewers installed on the device. However I need the built in Gallery app to be chosen because upon selecting an image it launches the screen to crop the image (same thing that com...

c++ initialize array in constructor without using default constructor or assinment

Consider: struct A { A (int); A (const A &); }; struct B { A foo [2]; B (const A & x, const A & y) : foo {x, y} /* HERE IS THE PROBLEM */ {} }; I was expecting this to work since I'm using C++0x support in GCC4.3, which allegedly supports initialiser lists. No joy. I have a class A which has no default constructor. This is...

How to remove default value of input on focus.

I have an input box that has default value text assigned to it. How can I remove this text when the user focuses on the field:: CoDE <input type="text" name="kp1_description" value="Enter Keypress Description"> ...

Getting the Listview default clicked color, depending on the Device

Hello all, In my android application, I use a listview and some linear layout on wich the user can click. Of course, I had to set the background of my LinearLayout to a xml file where the stated pressed, selected are defined: myView.setBackgroundDrawable( getDrawable(android.R.drawable.list_selector_background)); So no problem I s...

SQL Server Find out default value of a column with a query

How can I find out the default value of a column in a table using a SQL query? Using the sp: sp_columns @tablename I get some info on the columns of a particular table but the default value of the columns is missing, How can I get it? ...

default method argument with class property?

I'm using php 5.2.6. I want to have a default value for an argument in a method, but it seems I'm getting a bit too clever. The class property `blnOverwrite' is defaulted an settable elsewhere in the class. I have a method where I want to have it settable again, but not override the existing value. I get an error when I try this: publ...

SybaseDB , change the default value of an existing column in a table.

I have a table called "downloads" with a few thousand rows. I just added a column called is_completed using the following command: ALTER TABLE downloads ADD is_completed BIT default 1 NOT NULL Now I would like to change the default value for is_completed to 0 - I tried this command to no avail: ALTER TABLE downloads MODIFY is_complet...

Android: change default Home Application

Hi All, for some specific requirement I am required to change Android Default Home application with my customized Home application ( a setting inside my app that will toggle default home = my application or previous home) I don't want the user to travel android settings that are very complicated. Can any one help me out like where it ...

Changing default port (i.e. 5037) on which adb server runs

I googled for 5 mins. I also searched for '5037' in all files in android sdk directory. I am a budding android developer and if there is no easy way of configuring adb to run on another port then I am ***king quitting android app development. ...

How to modify the default button state in Android without affecting the pressed and selected states?

I am trying to remove an ImageButton's background in only the default state. I'd like the pressed and selected states to behave as usual so that they look correct on different devices, which use different colors for the pressed and selected states. Is there any way to set an ImageButton's background default state's drawable without affe...

I need C++ array class template, which is fixed-size, stack-based and doesn't require default constructor

So, I've been looking at boost::array but it does require default constructor defined. I think the best way of filling this array with data, would be through a push_back(const T&) method. Calling it more times than SIZE (known at compile-time) would result in assert or exception, depending on build configuration. This way it would always...

make a column in sybase default to the current date/time of row insertion

I have a sybase 15 DB and for one of my tables, I want to make a column default to the current date/time of the row insert. Is this possible? In a sybase text, the following is said: ALTER TABLE sales_order MODIFY order_date DEFAULT CURRENT DATE On my DB this dosn't do anything ,as CURRENT DATE is not recognized. ...

ruby default argument idiom

What's the idiom in Ruby when you want to have a default argument to a function, but one that is dependent on another parameter / another variable? For example, in Python, an example is: def insort_right(a, x, lo=0, hi=None): if hi is None: hi = len(a) while lo < hi: mid = (lo+hi)//2 if x < a[mid]: hi = m...

Default cURL option values

I was refactoring my cURL class today and thought about looking at default values of cURL FLAGS. Could anyone tell me where I might find or how could I output them? PS: If it's possible at all. ...

Get SQL Insert to work when PK is supplied or NOT.

Hi All I have the following stored procedure: ALTER Procedure dbo.APPL_ServerEnvironmentInsert ( @ServerEnvironmentName varchar(50), @ServerEnvironmentDescription varchar(1000), @UserCreatedId uniqueidentifier, @ServerEnvironmentId uniqueidentifier OUTPUT ) WITH RECOMPILE AS -- Stores the ServerEnvironmentId. DE...

Help to Simplify SQL Insert which uses NEWSEQUNETIALID() column default

Hi All I have the following insert stored procedure: CREATE Procedure dbo.APPL_ServerEnvironmentInsert ( @ServerEnvironmentName varchar(50), @ServerEnvironmentDescription varchar(1000), @UserCreatedId uniqueidentifier, @ServerEnvironmentId uniqueidentifier OUTPUT ) WITH RECOMPILE AS -- Stores the ServerEnvironmentId...

PDFTK - and the ability to change the default view

Hi All, I have been merging PDFs using PDFTK with great success, the pages that are used to generate the pdf are set to 'click to show one page at a time' (basically the whole of the first page is displayed when the pdf opens, based on the height of the page). however the generated pdf defaults back to filling the reader based on its w...

Can't I define defaults if I define multiple overloaded constructors in Scala?

I've defined multiple constructors, with some default argument values in all of them. Looks correct (I can't see any ambiguity), but Scala (2.8) compiler complains: multiple overloaded alternatives of constructor define default arguments Does it mean that I can't define default values for overloaded constructors at all? Let me ill...