default-value

Set highcharts y-axis min value to 0, unless there is negative data

倾然丶 夕夏残阳落幕 提交于 2019-12-04 23:47:01
I'm having an issue with highcharts where I have a number of different charts being generated by JSON calls. For the majority of these charts I need the minimum y-axis value to be set at 0, however there are a couple of occasions where negative values need to be shown. How can I tell highcharts to have a minimum y-axis value of 0 only if there are no negative values in the data, is this even possible? Thanks The option that you're looking for is called softMin and was introduced in version 5.0.1 . The docs describe it as follows: A soft minimum for the axis. If the series data minimum is

Specify default property value as NULL in Spring

半世苍凉 提交于 2019-12-04 22:16:02
I want to define default property value in Spring XML configuration file. I want this default value to be null . Something like this: ... <ctx:property-placeholder location="file://${configuration.location}" ignore-unresolvable="true" order="2" properties-ref="defaultConfiguration"/> <util:properties id="defaultConfiguration"> <prop key="email.username" > <null /> </prop> <prop key="email.password"> <null /> </prop> </util:properties> ... This doesn't work. Is it even possible to define null default values for properties in Spring XML configuration? It is better to use Spring EL in such way

Default values for empty groups in Linq GroupBy query

一世执手 提交于 2019-12-04 19:23:37
I have a data set of values that I want to summarise in groups. For each group, I want to create an array big enough to contain the values of the largest group. When a group contains less than this maximum number, I want to insert a default value of zero for the empty key values. Dataset Col1 Col2 Value -------------------- A X 10 A Z 15 B X 9 B Y 12 B Z 6 Desired result X, [10, 9] Y, [0, 12] Z, [15, 6] Note that value "A" in Col1 in the dataset has no value for "Y" in Col2. Value "A" is first group in the outer series, therefore it is the first element that is missing. The following query

Get default value of stored procedure parameter

感情迁移 提交于 2019-12-04 14:02:37
I have created below stored procedure with default value: CREATE PROCEDURE [dbo].[Sample1] @OrderID INT = 10285 AS SELECT ProductName, OrderID FROM Products P, [Order Details] Od WHERE Od.ProductID = P.ProductID AND Od.OrderID = @OrderID Tried to get default value (10285) of parameters using sys.parameters . Select a.object_id, a.default_value from sys.parameters a inner join sys.types b on b.system_type_id = a.system_type_id where Object_id = object_id('[dbo].[Sample1]') But I got NULL as default_value , while I was expecting 10285 as default_value . Is there any way to get default value? It

How to define default null value in application.yml in Spring Boot

冷暖自知 提交于 2019-12-04 09:35:52
问题 I'm trying to define the default value as null value in application.yml with SpringBoot version 1.3.0.RELEASE. The goal is be able to refer it with a class with ConfigurationProperties annotation -- application.yml -- test.foo: ${test.bar:#{null}} but it doesn't work. If the value of test.bar is not defined, set test.foo to null (default value) I already have spring-el in my dependencies. I don't want to use PropertyPlaceholderConfigurer.setNullValue It's seem to work in @Value but not in

Mathematica: set default value for argument to nonconstant?

浪子不回头ぞ 提交于 2019-12-04 09:09:16
Can I set the default value for a function argument to be something that's not constant? Example: tod := Mod[AbsoluteTime[], 86400] f[x_:tod] := x In the above, 'tod' changes every time I evaluate it, but "f[]" does not. "?f" yields: f[x_:42054.435657`11.376386798562935] := x showing the default value was hardcoded when I created the function. Is there a workaround here? It seems to work if the function holds its arguments: tod := Mod[AbsoluteTime[], 86400] SetAttributes[f, HoldAll]; f[x_: tod] := x In[23]:= f[] Out[23]= 47628.994048 In[24]:= f[] Out[24]= 47629.048193 Or you can use a

How to set a Postgresql default value datestamp like 'YYYYMM'?

丶灬走出姿态 提交于 2019-12-04 08:47:59
问题 As title, how can I set a table's column to have the default value the current year and month, in format 'YYYYMM', like 200905 for today? 回答1: Please bear in mind that the formatting of the date is independent of the storage. If it's essential to you that the date is stored in that format you will need to either define a custom data type or store it as a string. Then you can use a combination of extract, typecasting and concatenation to get that format. However, I suspect that you want to

Python nested dictionary lookup with default values

你离开我真会死。 提交于 2019-12-04 07:51:56
>>> d2 {'egg': 3, 'ham': {'grill': 4, 'fry': 6, 'bake': 5}, 'spam': 2} >>> d2.get('spamx',99) 99 >>> d2.get('ham')['fry'] 6 I want to get value of fry inside of ham, if not, get value, 99 or 88 as the 2nd example. But how? d2.get('ham', {}).get('fry', 88) I would probably break it down into several statements in real life. ham = d2.get('ham', {}) fry = ham.get('fry', 88) For the default values of get to work correctly the first default needs to be a dictionary, so that you can chain the .get calls correctly if the first fails. d.get('ham',{}).get('fry',88) you could also use a try, except

Default value of an Objective-C struct and how to test

隐身守侯 提交于 2019-12-04 07:48:59
问题 I'm trying to test if a property has been set yet. I know that with objects that I've got: CGRect ppGoalFrame; LocalPlaySetup *localPlaySetup; and I can test if (localPlaySetup == nil) but if I attempt to test the CGRect with == nil or == NULL if (ppGoalFrame == nil) I get invalid operands to binary == (have 'CGRect' and 'void *') So is the CGRect "void", null, nil...? before it's set? Obviously I can't compare CGrect to a void pointer (I can't use ppGoalFrame == void ); is there another way

Using a constant NSString as the key for NSUserDefaults

淺唱寂寞╮ 提交于 2019-12-04 07:39:11
问题 I'm using NSUSerDefaults to store user preferences. I remember reading somewhere that setting the keys as constants is a good idea - and I agree. The following code is what I currently have: [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInt:polygon.numberOfSides] forKey:@"polygonNumberOfSides"]; I tried changing this to: @implementation Controller NSString const *kPolygonNumberOfSides = @"polygonNumberOfSides"; -(void)savePolygonInfo { [[NSUserDefaults