calculate

Calculate Video Duration

I suck at math. I need to figure out how to calculate a video duration with only a few examples of values. For example, a value of 70966 is displayed as 1:10 minutes. A value of 30533 displays as 30 seconds. A value of 7007 displays as 7 seconds. ...

How can I automatically calculate axis scale and intervals?

Does anyone know where I can find an algorithm that given a set of values (dates) for an axis I can calculate a reasonable scale and tick interval? ...

How do you do calculations in Access?

In Microsoft Access I have a table called Time Sheet and in this I have Time sheet no. , waiter no. , date and hours worked. I have 10 waiters. I have another table called Service Charge Distribution. In this table I have Service Charge No. , waiter no. , week no. and distribution amount. There is a Bill table where the Service charg...

Estimate approximate power consumption of a PC

I wanted to know whether we can approximate the power consumption of the PC if we have 1> sum of peak power consumption of all PC components in Watts (P) 2> machine uptime (T) 3> Avg CPU usage (Pcpu - a number between 0 and 1) 4> Power supply power factor (PF - a number between 0 and 1) I have formulated this equation. Please verify i...

Simple calculation in SQL Server

I got a distance field in my database that stores the distance traveled on a specific route. I need to select all the distance fields and plus them together, then returning the result from my stored procedure. How can this be done? ...

How to calculate difference of two fields on form submit Ruby on Rails

I am new to Ruby on Rails and have been using Scaffolding. On one of the forms I want to be able to have two fields and then have the difference between the two submitted to the database. Instead of :pickupamount, I want (Ending Amount - Starting Amount) to be calculated and entered into the pickupamount column of my database. Thanks ...

Javascript Calculate the sum off multiple HTML-input values

Hi everyone, im looking for some Javascript code to calculate the sum off multiple HTML-input values. The amount off inputs are dynamic so i'm looking for something like "for each" input. the format off the numbers is 1 000,00 (space as thousand separator and , as decimal separator). My inputs are in and array so the ID's and NAME's is...

Help me fix and refactor this calculator script in JavaScript / JQuery.

Hi guys, I decided to try and learn more JQuery and here is what I have come up with. It should be a simple enough job, but I can't get my head around it. I can add it up, but when I change a package, the price just keeps going up. I know I have to add some logic to decrement the counter, too, but I think a fresh pair of eyes would be...

Recalculate image map after window resize

I have an interesting problem: My girfriend (painter...) wants to have a web page like this: first page is just an image, through all screen - with no slider etc. So here is the problem of resizing images for different resolutions. On this image are some windows, where user can navigate throught the rest of the page. SOLUTIONS: So...

jQuery Calulation Plugin - Simple Advice Needed.

Hey everyone, Simple question, but I can't figure it out. What is the launcher syntax I need to perform the following function: <input type="text" id="value1" /> <input type="text" id="value2" /> <input type="text" id="value3" /> <input type="text" id="total" /> I want to perform [(value1 * value2) + value3] and have the result roun...

Calculating Length Based on Sensor Data

I've got an IR sensor which writes its current information to a token which I then interpret in a C# application. That's all good -- no problems there, heres my code: SetLabelText(tokens [1],label_sensorValue); sensorreading = Int32.Parse(tokens[0]); sensordistance = (mathfunctionhere); Great. So the further away the IR sensor is from...

Calculate two dates with PHP?

I have two dates in the format below: Start Date = 30-10-2009 End Date = 30-11-2009 How, with PHP could I calculate the seconds between these two dates? ...

Determine total size of SVN directory/trunk

Is there a way to count/calculate the total size of a svn directory if you were to checkout a revision? I have limited internet downloads so I need to know how big something is before I go and download it. Thank you. ...

Write a function int caluculate_sum(int *a, int size) that calculates the sum of all the elements in an array.

This is what I was given to start with. int main(){ int a[5] = {0,1,2,3,4}; printf("Sum of elements of a: %d\n", calculate_sum(a,5)); return 0; } Here's what I've got, I don't know why it doesn't work, please help me. #include <stdio.h> int main() { int a[5] = {0,1,2,3,4}; int b; ...

Calculate time between time-1 to time-2?

enter time-1 // eg 01:12 enter time-2 // eg 18:59 calculate: time-1 to time-2 / 12 // i.e time between 01:12 to 18:59 divided by 12 How can it be done in Python. I'm a beginner so I really have no clue where to start. Edited to add: I don't want a timer. Both time-1 and time-2 are entered by the user manually. Thanks in advance fo...

Sum values by year with MySQL/PHP

I've got a minor problem with a database admin page that I use to update values and totals in a MySQL database for generating various figures and data for a website. A bit of background - the database table in question holds fundraising totals for a charity bookstall, with the table having three columns - id, date, and amountraised. Sum...

Calculate Javascript not working on PC, but works on Mac. Can someone point out the error?

I have a small javascript pricing calculation that is not working on a friend's PC, but it works fine on my Mac. I'm guessing it's a semi-colon or something small that's not in the correct spot? Please help if you can?! The full page can be found @ http://procollage.com/pricing/photo-collage-pricing.html. Thank you all, again, in advance...

'if' scenario in an equation. How do I implement it?

Hey guys, Basically I've been trying to make a working hours calculator and I've run into a problem. When the start time's value is greater than the finish time (eg. start is 23 and finish is 19), the result comes up as a negative. So what I want it to do in that scenario is to then multiply the negative number by -1 to make it positi...

How to calculate Min and Max values for IEEE Extended Double precision?

I know that the min and values are: 3.362... 10-4932 1.189... 10+4932 and log(2^14)~4932 which gives me the exponential part. But I can't figure out mantissa. ...

sed calculations

Hi. I want to parse a css file and multiply each pixel value by (2/3). I was wondering if this was possible with sed? I know this is incorrect syntax but i think it'll bring home the explanation of what i want to achieve: sed -e "s|\([0-9]*\)px|int((\1 * 2)/3)|g" file.css So basically I want to take \1, multiply it by (2/3) and cas...