formula

formula to calculate bounding coordinates of an arc in space

允我心安 提交于 2019-12-05 19:59:32
I have 2 lines that intersect at a point with know coordinates - x1,y1 - x2,y2 - x3,y3 From this I have calculated an arc at a given radius between the lines. So I now know - 2 arc endpoints x4,y4 and x5,y5 - arc centrepoint Cx,Cy - arc radius r - starting and ending angles relative to the X axis in polar and therefore the angle between the lines. I want to create a formula that will calculate the maximum and minimum X and Y values of the arc. I.e. the coordinates of the box that would enclose the arc. In the example below I can find out the minimum X value and maximum Y value, they are known

Hibernate: Many-to-one using Formula

天涯浪子 提交于 2019-12-05 18:24:43
I hope someone can help me find an answer. I'm working with a legacy database and I can't change any of the preexisting tables, because other apps depend on them. I have three main existing tables: A,B,C . A has a column with reference to B(many to one relation). The problem is that it should have a relation to C not to B. So I have created a *-1 mapping BC. Tables: A,B,C,BC (all have ID field) A-B many to one B-C many to one through BC Needed:A-C without altering A,B or C I don't want to have java entities for B or BC, just A and C, and A should have a field A.c So far I have tried using the

All possible moves in a 5x5 grid?

▼魔方 西西 提交于 2019-12-05 18:17:20
s o o o o o o o o o o o o o o o o o o o o o o o e How can I calculate all possible paths, without using the same square twice, that a person could take to get from s to e ? I've created a grid array [[1,1]...[5,5]] but i dont know if that will work. I've also mapped possible squares, and tried to create a record and check and lots of junk. Any standard formula I could put to use here? There are quite a few standard path finding algorhythms you could use for this. This is not related to javascript. You can use one algorhythm without heuristics, and you should not stop on the first solution.

How can we decide the total no. of buckets for a hive table

泪湿孤枕 提交于 2019-12-05 16:31:20
i am bit new to hadoop. As per my knowledge buckets are fixed no. of partitions in hive table and hive uses the no. of reducers same as the total no. of buckets defined while creating the table. So can anyone tell me how to calculate the total no. of buckets in a hive table. Is there any formula for calculating the total number of buckets ? Lets take a scenario Where table size is: 2300 MB, HDFS Block Size: 128 MB Now, Divide 2300/128=17.96 Now, remember number of bucket will always be in the power of 2. So we need to find n such that 2^n > 17.96 n=5 So, I am going to use number of buckets as

Google Docs spreadsheet formula for most frequent keywords

心不动则不痛 提交于 2019-12-05 16:18:56
I wonder if there is a formula in Google Docs Spreadsheet which could identify and display (for example in column D) the most frequent (key)words in a spreadsheet? Let's say that I have a column (Column B) full of tweets (see example image) and I would like to find top keywords in the column B and display them in column D. Is there a way to do that? Thank you! To return the top 10 individual words in column B, with their frequency, try: =ArrayFormula(QUERY(TRANSPOSE(SPLIT(JOIN(" ";B3:B);" ")&{"";""});"select Col1, count(Col2) group by Col1 order by count(Col2) desc limit 10 label Col1 'Word',

Using OR & AND in COUNTIFS

谁都会走 提交于 2019-12-05 11:37:57
问题 I would like to include an "AND" condition for one of the conditions I have in my COUNTIFS clause. Something like this: =COUNTIFS(A1:A196;{"Yes"or "NO"};J1:J196;"Agree") So, it should return the number of rows where: (A1:A196 is either "yes" or "no") AND (J1:j196 is "agree") 回答1: You could just add a few COUNTIF statements together: =COUNTIF(A1:A196,"yes")+COUNTIF(A1:A196,"no")+COUNTIF(J1:J196,"agree") This will give you the result you need. EDIT Sorry, misread the question. Nicholas is right

Fast formula for a “high contrast” curve

空扰寡人 提交于 2019-12-05 10:28:36
My inner loop contains a calculation that profiling shows to be problematic. The idea is to take a greyscale pixel x (0 <= x <= 1), and "increase its contrast". My requirements are fairly loose, just the following: for x < .5, 0 <= f(x) < x for x > .5, x < f(x) <= 1 f(0) = 0 f(x) = 1 - f(1 - x), i.e. it should be "symmetric" Preferably, the function should be smooth. So the graph must look something like this: . I have two implementations (their results differ but both are conformant): float cosContrastize(float i) { return .5 - cos(x * pi) / 2; } float mulContrastize(float i) { if (i < .5)

Have a Crystal Reports formula convert numeric strings to values, but leave non-numeric blank/null

喜夏-厌秋 提交于 2019-12-05 10:10:35
I have a string field that mostly contains numeric decimal values, but sometimes contains values like "<0.10" or "HEMOLYSIS". I want to use a formula to convert these numeric value strings to values, leaving non-values blank (null). if isNumeric({a_omgang.omg_resultat}) then toNumber({a_omgang.omg_resultat}) returns 0 for all non-numeric values, which makes it hard to calculate e.g. average or mean, or to count the number of values. (The latter can of course be achieved by using a running total count with isNumeric evaluation formula.) Any suggestions how I can get the formula to work as I

Need a formula interpreter for .Net [closed]

爷,独闯天下 提交于 2019-12-05 07:21:45
I'm looking for a formula interpreter that I can use in a C# application. It needs to be able to interpret a string like this: max(1+2, 4) * x I found Writing a fast formula interpreter (codeproject.com) which almost does what I need but it doesn't allow for functions with multiple parameters. I could probably add that functionality to it but I was just wondering if something like this already exists. Thanks A couple I've used in the past with no problems: NCalc Fast Lightweight Expression Evaluator You can actually build a very effective interpreter by parsing and replacing certain functional

Add a cell formula in Excel via vba

雨燕双飞 提交于 2019-12-05 07:11:44
I’m not an Excel or VBA expert but I want to insert this current excel formula into cell’s using VBA. Current Excel formula: =IF(OR(ISNUM(D570)=FALSE;ISNUM(D573)=FALSE);"";IF(C573="Total";D573-D570;"")) VBA formula : ActiveSheet.Range("a" & ActiveSheet.Rows.Count).End(xlUp).Offset(2, 12).Value = "=IF(OR(ISNUM(R[-3]C[-9])=FALSE;ISNUM(R[0]C[-9])=FALSE);'';IF(R[0]C[-10]='Total';R[0]C[-9]-R[-3]C[-9];''))" It doesn’t work… Someone can help me please? Try using .formula = instead of .value = in your VBA code. Setting the .value of a cell simply copies in whatever value you specify. In this case,