default

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

微笑、不失礼 提交于 2019-11-28 17:42:41
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.) If you want to do this manually, you can use Management Studio to find it (under the Constraints node inside the table). To do it using SQL: If the constraints are default constraints, you can use sys.default_constraints to find it: SELECT OBJECT_NAME(parent_object_id) AS TableName, name AS ConstraintName FROM sys.default_constraints ORDER BY TableName, ConstraintName If you are looking for

How to set the default font for a WPF application?

爱⌒轻易说出口 提交于 2019-11-28 16:28: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 inherit the font. But I think any dialog windows will go back to the default font, which is not exactly

How to change the default font size in ggplot2

霸气de小男生 提交于 2019-11-28 15:45:58
I'd like to know if it is possible to change some default parameters of ggplot2 graphics, like font size for instance, for a whole R session. The idea is to avoid setting them for each plot. Use theme_set() theme_set(theme_gray(base_size = 18)) qplot(1:10, 1:10) Thierry Use theme_set if you want to update for the remainder of your active session: theme_set(theme_grey(base_size = 18)) If you only want to change one graph you can set the base_size in the theme: qplot(1:10, 1:10) + theme_grey(base_size = 18) ggplot(mtcars, aes(x = mpg, y = cyl)) + geom_point() + theme_grey(base_size = 18) 来源:

How can I force 2 fields in a Django model to share the same default value?

放肆的年华 提交于 2019-11-28 14:20:46
I have a Django model MyModel as shown below. It has two fields of type DateTimeField: my_field1 , my_field2 from django.db import models from datetime import datetime class MyModel(models.Model): my_field1 = models.DateTimeField(default=datetime.utcnow, editable=False) my_field2 = models.DateTimeField( # WHAT DO I PUT HERE? ) I want both fields to default to the value of datetime.utcnow() . But I want to save the same value for both. It seems wasteful to call utcnow() twice. How can I set the default value of my_field2 so that it simply copies the default value of my_field1 ? The proper way

How do you change default stack size for managed executable.net

折月煮酒 提交于 2019-11-28 12:37:13
We have discovered that one of our auto generated assemblies is throwing a StackOverflowException on new(). This class has (bear with me please) 400+ simple properties that are initialised (most by default(string) etc) in a constructor. We notice that its fine on 64 bits but on 32 bits it goes bang! We need to test if it's reasonable for our use case to create a larger default stack to give us breathing room while we reengineer the code generator. We would esp. interested in solutions that involve app.config if possible. But I'm a realist so anything would be good. Re reasons for the the stack

PHP switch case default

老子叫甜甜 提交于 2019-11-28 12:24:01
Will the default of a switch statement get evaluated if there's a matching case before it? ex: switch ($x) { case ($x > 5): print "foo"; case ($x%2 == 0): print "bar"; default: print "nope"; } so for x = 50, you'd see foo and bar , or foo and bar and nope ? Yes, if there is no "break", then all actions following the first case matched will be executed. The control flow will "falls through" all subsequent case , and execute all of the actions under each subsequent case , until a break; statement is encountered, or until the end of the switch statement is reached. In your example, if $x has a

MySQL default value as other field's value

限于喜欢 提交于 2019-11-28 12:01:22
Can I, and, if I can, how can I set the default value of a field in a MySQL table to the value of another field? Thing is: I have data, and each data object has its ID in the table. But, I would like the possibility to rearrange the data, changing their sorting index, without altering their ID. Thus, the field sort_num should by default be set to the value given to the auto-incremented indexed field ID . Thanks in advance! I see two possible solutions for this: 1. Possibility: You use a function to simply ignore sort_num if it is not set: `SELECT * FROM mytable ORDER BY coalesce(sort_num, id)`

Generate UUID values by default for each row on column of UUID type in H2 Database Engine

妖精的绣舞 提交于 2019-11-28 11:34:21
In the H2 database , on a table with a column of UUID data type , how do we specify that we want H2 to generate a UUID value by default when an INSERT omits that field? I know how to generate a UUID . I have read the Question, How to insert a specific UUID in h2 database? . My question is about how to ask H2 to generate the UUID value on my behalf. Thomas Mueller You can use built-in function RANDOM_UUID() : create table test(id int primary key, data uuid default random_uuid()); insert into test(id) values(1); select * from test; Note that using the UUID (or any other randomly generated data)

How can I remove a default gem? ! want to uninstall a gem 1.7.7 version of json

喜欢而已 提交于 2019-11-28 10:57:02
I have the same rails app in OSX and Ubuntu, I want to use Zeus to speed up my rspec. In Ubuntu, Zeus starts Ok, but in OSX it always be crashed. At last I find the issue, https://github.com/burke/zeus/issues/237#issuecomment-18700462 the difference between OSX and Ubuntu is the version of json gem. I use gem list | grep json Ubuntu shows json (1.8.1, 1.8.0, 1.5.3) json_pure (1.5.3) json_spec (1.1.1) jsonpath (0.5.3) multi_json (1.8.2, 1.7.8, 1.0.3) Mac shows json (1.8.1, 1.7.7) json_spec (1.1.1) jsonpath (0.5.5, 0.5.3) multi_json (1.8.2, 1.7.8) so I want to uninstall 1.7.7 version of json gem

Localization of Default.png is not working

可紊 提交于 2019-11-28 09:28:37
I wonder if anyone has encountered the same problem and how they solve it. I want to localize Default.png so I do the following steps which from what I understand should be the correct way (please correct me if I'm wrong). Select Default.png in xcode Command-I to Get Info Click on Make File Localizable Go back to General Tab (why Apple, why?) Click on Add Localization Enter es for Spanish according to this: In finder I replace the Default.png in the es.lproj folder I have tried in both the simulator and on an iPhone with changing the language between English and Spanish, but I only get the