zero

Highcharts: Displaying zero values in logarithmic scale

天大地大妈咪最大 提交于 2019-11-29 12:06:32
I am working with logarithmic scale in the y-axis I know that log(0) doesn't exist but I need to draw 0 values, and I need a log scale. I read in other answers that changing the zero values to null solve the problem, but it is not working for me. See the example: http://jsfiddle.net/QEK3x/15/ Thank you in advance. SteveP Although not perfect, the best I came up with was to set the zero point to 0.0001 and then set the y-axis min to 0.0001: http://jsfiddle.net/6LHT8/ yAxis: { min:0.0001, type: 'logarithmic' }, series: [{ data: [100,10,0.0001,0.1,0.01,0.1] }] Also, this answer may nelp:

Is there a difference between BigDecimal(“0”) and BigDecimal.ZERO?

冷暖自知 提交于 2019-11-29 10:56:24
问题 Either for comparisons or initialization of a new variable, does it make a difference which one of these you use? I know that BigDecimal.ZERO is a 1.5 feature, so that's a concern, but assuming I'm using 1.5 does it matter? Thanks. 回答1: BigDecimal.ZERO is a predefined constant and therefore doesn't have to be evaluated from a string at runtime as BigDecimal("0") would be. It will be faster and won't require creation of a new object. If your code needs to run on pre-1.5, then you can use the

Highcharts - best way to handle and display zero (or negative) values in a line chart series with logarithmic Y axis

懵懂的女人 提交于 2019-11-29 10:38:46
In my HighChart line graphs, the series data is being fed from my Ruby on Rails application dynamically. Sometimes the series values are zeros or less which is a problem for HighCharts and it throws the following exception: Highcharts Error #10 Can't plot zero or subzero values on a logarithmic axis So as a work-around, I process my ruby array to conditionally replace a zero of less value with an insignificant positive number, .e.g. 0.00001 as shown below: oil_vol_array = d_array[1].map { |e| (e < 0.0001) ? 0.0001 : e.round(3) } This prevents the exception being thrown, but the display shows

Is null considered zero and undefined not a number on arithmetic expressions?

ε祈祈猫儿з 提交于 2019-11-29 09:17:06
Is null evaluated to 0 and undefined to NaN on arithmetic expressions? According to some testing it seems so: > null + null 0 > 4 + null 4 > undefined + undefined NaN > 4 + undefined NaN Is it safe or correct to assume this? (a quote from a documentation would be A+). Is null evaluated to 0 and undefined to NaN on arithmetic expressions? Is it safe or correct to assume this? Yes, it is. An "arithmetic expression" would use the ToNumber operation : Argument Type | Result --------------+-------- Undefined | NaN Null | +0 … | It is used in the following "arithmetic" expressions: prefix / postfix

Add leading zeroes to awk variable

半腔热情 提交于 2019-11-29 07:11:12
问题 I have the following awk command within a "for" loop in bash: awk -v pdb="$pdb" 'BEGIN {file = 1; filename = pdb"_" file ".pdb"} /ENDMDL/ {getline; file ++; filename = pdb"_" file ".pdb"} {print $0 > filename}' < ${pdb}.pdb This reads a series of files with the name $pdb.pdb and splits them in files called $pdb_1.pdb, $pdb_2.pdb, ..., $pdb_21.pdb, etc. However, I would like to produce files with names like $pdb_01.pdb, $pdb_02.pdb, ..., $pdb_21.pdb, i.e., to add padding zeros to the "file"

Empty string inserting a zero, not a null

时光怂恿深爱的人放手 提交于 2019-11-29 04:13:44
My insert statement looks like this: INSERT INTO foo (bar) VALUES (''); The bar field was created like so: bar INT(11) COLLATION: (NULL) NULL: YES DEFAULT: (NULL) MySQL version: 5.1. Shouldn’t an empty string insert a NULL? I’m not sure why I’m seeing a zero (0) being stored in the table. MySQL by default attempts to coerce invalid values for a column to the correct type. Here, the empty string '' is of type string, which is neither an integer nor NULL. I suggest taking the following steps: Change the query to the following: INSERT INTO foo (bar) VALUES (NULL); Enable strict mode in MySQL.

Mysql count return Zero if no record found

馋奶兔 提交于 2019-11-28 20:43:47
I have a two tables. cities - id_city, city_name properties - id_property, id_city, property_name I want to display cities.city_name and next to it [properties.count(id_city)] How do I make a query that still returns zero if no records are found instead of NULL , so that I get results like this: London [123] New York [0] Berlin [11] where "New York" is [0], not NULL and not 1? ChssPly76 Use an outer join: select cities.city_name, count(properties.id_city) from cities left join properties on cities.id_city = properties.id_city group by 1 I think the following will do it for you, though I haven

Equals operator for zeros (BigDecimal / Double) in Java

别等时光非礼了梦想. 提交于 2019-11-28 20:09:30
A few interesting observations w.r.t equals operator on 0 and 0.0 new Double(0.0).equals(0) returns false, while new Double(0.0).equals(0.0) returns true. BigDecimal.ZERO.equals(BigDecimal.valueOf(0.0)) returns false, while BigDecimal.ZERO.equals(BigDecimal.valueOf(0)) returns true. Looks like the string comparison is being done in both the cases. Could anyone throw some light on this. Thanks. assylias BigDecimal 'equals' compares the value and the scale. If you only want to compare values (0 == 0.0) you should use compareTo: BigDecimal.ZERO.compareTo(BigDecimal.valueOf(0.0)) == 0 //true

Extract contours from ContourPlot in Mathematica

早过忘川 提交于 2019-11-28 18:26:21
I have a function f(x,y) of two variables, of which I need to know the location of the curves at which it crosses zero. ContourPlot does that very efficiently (that is: it uses clever multi-grid methods, not just a brute force fine-grained scan) but just gives me a plot. I would like to have a set of values {x,y} (with some specified resolution) or perhaps some interpolating function which allows me to get access to the location of these contours. Have thought of extracting this from the FullForm of ContourPlot but this seems to be a bit of a hack. Any better way to do this? If you end up

Sum of numbers + 0

倖福魔咒の 提交于 2019-11-28 14:39:42
I am having a problem with a small number. I am using SUM function to sum certain numbers. If I add a zero to the range, it is not displaying zero. I don't know why. A1 =SUM(B1:R1)*-1 C1 to L1 266864 -100000 -15136.15 -23688.82 -120870 -7169 -5550 1224 -0.03 4326 A2 =SUM(B2:R2)*-1 C2 to M2 =SUM(C3:C3) =SUM(D3:D3) =SUM(E3:E3) =SUM(F3:F3) =SUM(G3:G3) =SUM(H3:H3) =SUM(I3:I3) =SUM(J3:J3) =SUM(K3:K3) =SUM(L3:L3) =SUM(M3:M3) A3 =SUM(B3:R3)*-1 C3 to M3 266864 -100000 -15136.15 -23688.82 -120870 -7169 -5550 1224 -0.03 4326 0 A1 is displaying 0, but A2 and A3 displays 9.09E-13 The number 9.09E-13 is