formula

How do I draw part of parabola using iText ? Or how do I create quadratic bezier curves from cubic bezier curves?

I need to draw a shape whose boundaries are parts of parabola (that is quadratic bezier curves) using iText. I have found only method for drawing cubic bezier curves in PdfContentByte class. So how do I draw quadratic bezier curves using iText ? One way would be to use method for cubic bezier curves. Is it possible to draw quadratic be...

Parcing formula to put in to excel cell using C# and SpreadSheetGear?

Hey can any body suggest that how to store excel formula as string, and parse this formula in c# to put it in to dynamically created excel sheet. ...

Is it possible to formulate the development cost?

Hi, Is there any formula showing the development cost of an application? Basically not to reach a very specific number but at least stressing what parts are effecting the overall cost in what magnitude? Thanks, burak ozdogan ...

optimization math computation (multiplication and summing)

Suppose you want to compute the sum of the square of the differences of items: $\sum_{i=1}^{N-1} (x_i - x_{i+1})^2$ the simplest code (the input is std::vector<double> xs, the ouput sum2) is: double sum2 = 0.; double prev = xs[0]; for (vector::const_iterator i = xs.begin() + 1; i != xs.end(); ++i) { sum2 += (prev - (*i)) * (prev - (...

How to allow users to define financial formulas in a C# app

I need to allow my users to be able to define formulas which will calculate values based on data. For example //Example 1 return GetMonetaryAmountFromDatabase("Amount due") * 1.2; //Example 2 return GetMonetaryAmountFromDatabase("Amount due") * GetFactorFromDatabase("Discount"); I will need to allow / * + - operations, also to assign...

Formulas in PHP

To a person skilled in programming, I know this question might seem ridiculous, but please bear with me. I'm involved in a court case and a critical point hinges on the answer to a couple of questions. Given a mathematical formula, along with complete formula documentation as shown here: (Pixelated some of the descriptors) In solvin...

Why are there 3 conflicting OpenCV camera calibration formulas?

I'm having a problem with OpenCV's various parameterization of coordinates used for camera calibration purposes. The problem is that three different sources of information on image distortion formulae apparently give three non-equivalent description of the parameters and equations involved: (1) In their book "Learning OpenCV…" Bradski ...

Drawing formulas with Quartz 2d

In my iPhone App I'd like to draw a few formulas. How can I manage that with quartz 2d? Is there a way to build formulas like for example in latex? Or are there any existing frameworks? Thanks. ...

How would I code a complex formula parser manually?

Hm, this is language - agnostic, I would prefer doing it in C# or F#, but I'm more interested this time in the question "how would that work anyway". What I want to accomplish ist: a) I want to LEARN it - it's about my ego this time, it's for a fun project where I want to show myself that I'm a really good at this stuff b) I know a ti...

parsing of mathematical expressions

(in c90) (linux) input: sqrt(2 - sin(3*A/B)^2.5) + 0.5*(C*~(D) + 3.11 +B) a b /*there are values for a,b,c,d */ c d input: cos(2 - asin(3*A/B)^2.5) +cos(0.5*(C*~(D)) + 3.11 +B) a b /*there are values for a,b,c,d */ c d input: sqrt(2 - sin(3*A/B)^2.5)/(0.5*(C*~(D)) + sin(3.11) +ln(B)) /*max lenght of formula is 250 characters...

Column variables in Excel?

Let's say I have column A and Column B. Cells in Column A contain either "Y" or "N". How can I set the value of the cell in the corresponding row in Column B with a formula that detects if the cell's value = "N"? Not new to programming logic but to Excel formulas, thanks for your help. -Ryan ...

Financial Data/Formula Calculation (Storage / Performance)

Hi. I am currently in the analysis phase of developing some sort of Locale-based Stock Screener ( please see Google's' for similar work) and I would appreciate advice from the SO Experts. Firstly the Stock Screener would obviously need to store the formulas required to perform Calculations. My initial conclusion would that the formulae w...

Formula for popularity? (based on "like it", "comments", "views")

I have some pages on a website and I have to create an ordering based on "popularity"/"activity" The parameters that I have to use are: views to the page comments made on the page (there is a form at the bottom where uses can make comments) clicks made to the "like it" icon Are there any standards for what a formula for popularity w...

simple rank formula

I'm looking for a mathmatical ranking formula. Sample is 2008 2009 2010 A 5 6 4 B 6 7 5 C 7 8 2 I want to add a rank column for each period code field rank 2008 2009 2010 2008 2009 2010 B 6 7 5 2 1 1 A...

Formula to draw pyramid of circles

I'm trying to create a pyramid of circles to my game, looking similar to this : But I can't make it print properly. Constantly I'm getting really strange spirals but nothing close to this. Can anyone give me some tip on proper formula ? My window is 600x600, base of pyramid is 8 . fields = new Field[BASE*(BASE/2)+4]; int line...

Referencing sheets in Apache POI Formulas

Hello, I am using apache POI 3.6 to generate excel (2003) sheets. I want to insert a formula to a cell which calculates a sum of a certain cells on several sheets. I have sheets named a, b and c and want to calculate the sum the cells A1 I tried: cell.setCellFormula("a!A1+b!A1+c!A1"); POI does not produce any errors, but when ...

Excel Formula: Calculate Survey Statistics

I have a survey from 100 users and I'm trying to calculate some statistics. The relevant fields in my survey look something like this: Gender Interests B1: Male D1: Running, Snowboarding, Mountain Bikes B2: Male D2: Programming, Running, Paintball B3: Female D3: Bowling, Gymnastics B4: Male D...

Right align a string formula in Crystal Reports

I've got a crystal reports formula that displays a string based on an input Simplified: if (a=1) then "Abc" else "Abcdefghijkl" The problem is that I want this field right aligned. In the "Format Editor" I have set the "Horizontal Alignment" to be "Right", but it hasn't changed the formatting when I run the report. Any idea'...

How is the intercept computed in the GLM fit ?

Hi! I have been reading the code used by R to fit a generalized linear model (GLM), since the source-code of R is freely available. The algorithm used is called iteratively reweighted least squares (IRLS), which is a fairly documented algorithm. For each iteration, there is a call to a Fortran function to solve the weighted least square...

opposite of enum (using formula) (objective-c)

I have 4 numbers 0-3 which is an enum (objective-c) and I'd like to get the opposite using a formula. So if 0 is put into the formula it returns 2 and if it 2 is entered then it returns 0 (and same with 1 and 3). The reason being (and it is programming related) that I want to get the opposite of an enum without having to do an if or swi...