default

How to insert default values in SQL table?

北城余情 提交于 2019-11-27 01:05:51
I have a table like this: create table1 (field1 int, field2 int default 5557, field3 int default 1337, field4 int default 1337) I want to insert a row which has the default values for field2 and field4. I've tried insert into table1 values (5,null,10,null) but it doesn't work and ISNULL(field2,default) doesn't work either. How can I tell the database to use the default value for the column when I insert a row? Just don't include the columns that you want to use the default value for in your insert statement. For instance: INSERT INTO table1 (field1, field3) VALUES (5, 10); ...will take the

Android: change default Home Application

左心房为你撑大大i 提交于 2019-11-27 00:46:28
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 registers launcher.apk for default home application or how to change that The only thing I could find was that old question: How to change default Android's Desktop application? but no answers at all. I have seen HomeSwitcher in the Market that do the trick, but no answer

How do I change the default index page in Apache?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 00:40:18
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 something else. Right now, when I browse my site it takes me to the reporting page. From what I see, whatever you call index.html it will pull that up as your default. I want to change that to landing.html. How do I do this? I am a folder (Folding @ Home). The reporting program is HFM.net. HFM can output an html file with my current folding

Find out if Android device is portrait or landscape for normal usage?

痞子三分冷 提交于 2019-11-27 00:21:06
问题 Is there anyway to find out if a device is portrait or landscape by default? In that I mean how you normally use the device. Most phones have a portrait screen for normal usage but is there some flag for finding that out? 回答1: You can do this by: For Lanscape if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE){ //Do some stuff } For Portrait if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){ //Do some stuff } Check:

How to set the default font for a WPF application?

自作多情 提交于 2019-11-27 00:11:32
问题 I want to be able to define a font family for my WPF application. Preferably using a resource dictionary as a theme referenced from App.xaml . I've tried creating a Style as follows: <Style TargetType="{x:Type Control}"> <Setter Property="FontFamily" Value="Segoe UI" /> </Style> But this doesn't work. Setting the type to TextBlock works for most controls but there are a few controls where this doesn't apply. I know you can set the font on a window and have all child controls of that window

What are the default font characteristics in Android ?

放肆的年华 提交于 2019-11-27 00:10:41
问题 I know that fonts properties can be found in the TypeFace class but I can't find the default characteristics of the writing in Android. I mean, if I take a TextView and simply do setText("Blabla") on it, what will I get? Which size in px? Which font? etc. 回答1: You can check the default style of the widgets here: android/res/values/styles.xml Then, looking for Textview you reach <style name="Widget.TextView"> <item name="android:textAppearance">?android:attr/textAppearanceSmall</item> </style>

Angularjs Template Default Value if Binding Null / Undefined (With Filter)

我们两清 提交于 2019-11-27 00:02:45
问题 I have a template binding that displays a model attribute called 'date' which is a date, using Angular's date filter. <span class="gallery-date">{{gallery.date | date:'mediumDate'}}</span> So far so good. However at the moment, if there is no value in the date field, the binding displays nothing. However, I would like it to display the string 'Various' if there is no date. I can get the basic logic using a binary operator: <span class="gallery-date">{{gallery.date || 'Various'}}</span>

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

£可爱£侵袭症+ 提交于 2019-11-26 22:35:32
I am a budding android developer and if there is no easy way of configuring the adb server to run on another port then the inflexibility of the tools will force me to quit android app development. A web search did not return any solutions. I also searched for '5037' in all files in android sdk directory but did not find a setting there. Use the environment variable ANDROID_ADB_SERVER_PORT to select the port. The following works under bash: $ export ANDROID_ADB_SERVER_PORT=12345 $ adb start-server * daemon not running. starting it now on port 12345 * * daemon started successfully * $ adb

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

戏子无情 提交于 2019-11-26 22:31:15
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 = new MyTemplate<int>(); Would be essentially: MyTemplate<int, string> t = new MyTemplate<int, string>(); Ultimately I am looking at a case wherein there is a template that is fairly widely used, but I am considering expanding with an additional type parameter. I

Set back default floating point print precision in C++

眉间皱痕 提交于 2019-11-26 20:36:07
问题 I want to control the precision for a double during a comparison, and then come back to default precision, with C++. I intend to use setPrecision() to set precision. What is then syntax, if any, to set precision back to default? I am doing something like this std::setPrecision(math.log10(m_FTOL)); I do some stuff, and I would like to come back to default double comparison right afterwards. I modified like this, and I still have some errors std::streamsize prec = std::ios_base::precision();