Search Results

Search found 2773 results on 111 pages for 'calculate'.

Page 5/111 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to calculate RAM value on performance per dollar spent

    - by Stucko
    Hi, I'm trying to make decisions on buying a new PC. I have most specifications (processor/graphic card/hard disk) pin-downed except for RAM. I am wondering what is the best RAM configuration for the amount of money I'm spending. As the question of best is subjective, I'd like to know how would I calculate the value of RAM sticks sold. 1.(sample)The value of amount of memory: 1) CORSAIR PC1333 D3 2GB = costs $80 2) CORSAIR PC1333 D3 4GB = costs $190 would it be better to buy 2 of item 1) instead of 1 of item 2) ?? Although I would normally choose to have 1 of 2) as the difference is only (190-(80*2)) = 30 as I would save 1 DIMM slot, What I need is the value per amount: 1) 80/ 2 = $40 per 1GB 2) 190/ 4 = $47.5 per 1GB 2. The value of frequency: 1) CORSAIR PC1333 4GB = costs 190 2) CORSAIR PC1600C7 4GB = costs 325 Im not even sure of the denominator ... $ per 1 ghz speed? 3. The value of latency: 1) CORSAIR CMP1600C8 8-8-8-24 2GBx3 (triple channel) = costs 589 2) CORSAIR CMP1600C7D 7-7-7-20 2GBx3 (triple channel) = costs 880 Im not even sure of the denominator ... $ per 1 ghz speed? Just for your information i'd like to get the best out of the money im going to spend to put on a 6 DIMM slot i7core motherboard.

    Read the article

  • calculate AUC (GAM) in R [migrated]

    - by ahmad
    I used the following script to calculate AUC in R: library(mgcv) library(ROCR) library(AUC) data1=read.table("d:\\2005.txt", header=T) GAM<-gam(tuna ~ s(chla)+s(sst)+s(ssha),family=binomial, data=data1) gampred<- predict(GAM, type="response") rp <- prediction(gampred, data1$tuna) auc <- performance( rp, "auc")@y.values[[1]] auc roc <- performance( rp, "tpr", "fpr") plot( roc ) But when I was running the script, the result is: **rp <- prediction(gampred, data1$tuna) Error in prediction(gampred, data1$tuna) : Format of predictions is invalid. > > auc <- performance( rp, "auc")@y.values[[1]] Error in performance(rp, "auc") : object 'rp' not found > auc function (x, min = 0, max = 1) { if (any(class(x) == "roc")) { if (min != 0 || max != 1) { x$fpr <- x$fpr[x$cutoffs >= min & x$cutoffs <= max] x$tpr <- x$tpr[x$cutoffs >= min & x$cutoffs <= max] } ans <- 0 for (i in 2:length(x$fpr)) { ans <- ans + 0.5 * abs(x$fpr[i] - x$fpr[i - 1]) * (x$tpr[i] + x$tpr[i - 1]) } } else if (any(class(x) %in% c("accuracy", "sensitivity", "specificity"))) { if (min != 0 || max != 1) { x$cutoffs <- x$cutoffs[x$cutoffs >= min & x$cutoffs <= max] x$measure <- x$measure[x$cutoffs >= min & x$cutoffs <= max] } ans <- 0 for (i in 2:(length(x$cutoffs))) { ans <- ans + 0.5 * abs(x$cutoffs[i - 1] - x$cutoffs[i]) * (x$measure[i] + x$measure[i - 1]) } } return(as.numeric(ans)) } <bytecode: 0x03012f10> <environment: namespace:AUC> > > roc <- performance( rp, "tpr", "fpr") Error in performance(rp, "tpr", "fpr") : object 'rp' not found > plot( roc ) Error in levels(labels) : argument "labels" is missing, with no default** Can anybody help me to solve this problem? Thank you in advance.

    Read the article

  • How to calculate CPU % based on raw CPU ticks in SNMP

    - by bjeanes
    According to http://net-snmp.sourceforge.net/docs/mibs/ucdavis.html#scalar_notcurrent ssCpuUser, ssCpuSystem, ssCpuIdle, etc are deprecated in favor of the raw variants (ssCpuRawUser, etc). The former values (which don't cover things like nice, wait, kernel, interrupt, etc) returned a percentage value: The percentage of CPU time spent processing user-level code, calculated over the last minute. This object has been deprecated in favour of 'ssCpuRawUser(50)', which can be used to calculate the same metric, but over any desired time period. The raw values return the "raw" number of ticks the CPU spent: The number of 'ticks' (typically 1/100s) spent processing user-level code. On a multi-processor system, the 'ssCpuRaw*' counters are cumulative over all CPUs, so their sum will typically be N*100 (for N processors). My question is: how do you turn the number of ticks into percentage? That is, how do you know how many ticks per second (it's typically — which implies not always — 1/100s, which either means 1 every 100 seconds or that a tick represents 1/100th of a second). I imagine you also need to know how many CPUs there are or you need to fetch all the CPU values to add them all together. I can't seem to find a MIB that gives you an integer value for # of CPUs which makes the former route awkward. The latter route seems unreliable because some of the numbers overlap (sometimes). For example, ssCpuRawWait has the following warning: This object will not be implemented on hosts where the underlying operating system does not measure this particular CPU metric. This time may also be included within the 'ssCpuRawSystem(52)' counter. Some help would be appreciated. Everywhere seems to just say that % is deprecated because it can be derived, but I haven't found anywhere that shows the official standard way to perform this derivation. The second component is that these "ticks" seem to be cumulative instead of over some time period. How do I sample values over some time period? The ultimate information I want is: % of user, system, idle, nice (and ideally steal, though there doesn't seem to be a standard MIB for this) "currently" (over the last 1-60s would probably be sufficient, with a preference for smaller time spans).

    Read the article

  • Best practice to calculate the average speed from GPS coordinates

    - by Sebi
    i have here a device which can give me gps coordinates. the time intervall i can define. i want to use it to calculate the average speed during driving or travelling by car. actually i used a orthodrome formula to calculate the distance between two points and then divided it by the given time intervall. by the implemenation i followed this term (http://de.wikipedia.org/wiki/Orthodrome#Genauere_Formel_zur_Abstandsberechnung_auf_der_Erde). Unfortunately i could only find a german link, but i think the formula should be understandable in any language ;) Unfortunately, using this formula and a time intverall of 1 seconds gives very unprecises results. the speed while walking is between 1 km/h and 20km/h. So i wonder if there is a general reference how to implement distance calculation between two gps coordinates (i found something similar on SO) and particulary, which is the best time intervall to update the GPS coordiantes.

    Read the article

  • create a YYYY-MM-DD Daterange in JScript/Javascript.

    - by Marcus
    Hello. I need no generate a full daterange in JScript from a given Startdate to now. Startdate: 2010-03-25 2010-03-26 2010-03-27 ... 2010-05-30 I am very confused with Javascript Date. best would be a function to give a daterange as params and getting an Array of the formatted date back, something like that: range[0] = 2010-03-25 range[1] = 2010-03-26 range[2] = 2010-03-27 ... range[x] = 2010-05-30 I am so confused thanks for any hint marcus

    Read the article

  • Quaddratic Bezier Curve: Calculate Tangent

    - by stefan.at.wpf
    Hello, I have have a quadratic bezier curve and I want to calculate the slope of the tangent in a given point. For example, let it be the middlepoint of the quadratic bezier curve, therefore t=0.5 (please see the link below for a picture of this). I've calculated the first derivation of the formula for the quadratic bezier curve, however I get 400 as value for the slope, though it should be 0. Maybe I'm using the first derivation in a wrong way? I know I could also calculate the tangents using trigonometric functions, however I'd like to do it using the first derivation, shouldn't this be possible? Thanks for any hint! For clarification / please note: I'm interested in a general way to get the slope in a arbitrary given point on a quadratic bezier curve, not only to get the tangent in the start- and end point. A picture of my problem including the text above: http://cid-0432ee4cfe9c26a0.skydrive.live.com/self.aspx/%c3%96ffentlich/Quadratic%20Bezier%20Curve.pdf Thank you very much for any hint!

    Read the article

  • Convert time to decimals in .net

    - by henrico
    Is there an easy way to present time (hh:mm) as a decimal value? Example, 01:08 should become 1,13. I have an asp:textbox masked (ajax) as time with the mask format "99:99". Next to this box I need to present the entered value as decimal. <asp:TextBox ID="time" runat="server" /> hh:mm ([time in decimal format]) <ajaxToolkit:MaskedEditExtender runat="server" Mask="99:99" TargetControlID="time" MaskType="Time" />

    Read the article

  • NSTimer calculate hours

    - by Nic Hubbard
    I am using an NSTimer which I have working to show minutes and seconds. But I am confused about the math needed to calculate hours. I am using: - (void)updateCounter:(NSTimer *)theTimer { static int count = 0; count += 1; int seconds = count % 60; int minutes = (count - seconds) / 60; // Not sure how to calculate hours int hours = (count - minutes) / 60; self.timer.text = [NSString stringWithFormat:@"%.2d:%.2d:%.2d", hours, minutes, seconds]; } What calculation should I use for hours?

    Read the article

  • Format number as I type Expand this post

    - by conorhiggins
    Hi I am working on an app at the moment that requires number input to be formatted as the textfield changes as well as perform a calculation. I have the text fields set up so that as the user types notifications are passed out and a calculation is performed. However what I need to do now is format the text to be in this style: €1,000,000 rather than 1000000. I have this working for the output of the calculation already but everytime I try to apply it to the input text the simulator seems to crash or at least freezes for a while. I'd imagine its a simple enough fix.

    Read the article

  • Adding Mysql Columns in Rails Rake

    - by Gigg
    I have a rake file that does a series of calculations on a database. Basically it adds usage on equipment regularly. At the end of the day it needs to add that days total to a monthly total table and update that same table. i use the following simple concepts: To get data from the database is pretty simple: @usages = Usage.find(:all) time = Time.new for usage in @usages sql = ActiveRecord::Base.connection To insert it into the database: sql.execute "INSERT (or UPDATE) into usages ## add values and options as per MySQL But how do I: take a column from a database, add all of its values together that have a common value in another column, (i.e. if column x == value y) and then insert it into another column in another table, say dailyusages? I have tried these options: task (:monthly => :environment) do @dailyusages = Dailyusage.find(:all) for dailyusage in @dailyusages sql = ActiveRecord::Base.connection time = Time.new device = monthlyusages.device month = time.month if device == dailyusages.device ##&& month == dailyusages.month total = (dailyusage.total.sum.to_i) @monthlyusages = Monthlyusage.find(:all) for monthlyusage in @monthlyusages sql = ActiveRecord::Base.connection old_total = monthlyusage.total.to_i new_total = (old_total + total) sql.execute "UPDATE monthlyusages ( year, month, total, device ) values('#{time.year}', '#{time.month}', '#{total}', '#{dailyusage.device}' )" end I obviously have uncommented options and tried all sorts of things. Any help would really save me a load of trouble. Thanks in advance. (** BTW - I am new to rails, so go easy on me **)

    Read the article

  • How to calculate a operation's time in micro second precision

    - by Sanjeet Daga
    I want to calculate performance of a function in micro second precision on Windows platform. Now Windows itself has milisecond granuality, so how can I achieve this. I tried following sample, but not getting correct results. LARGE_INTEGER ticksPerSecond = {0}; LARGE_INTEGER tick_1 = {0}; LARGE_INTEGER tick_2 = {0}; double uSec = 1000000; // Get the frequency QueryPerformanceFrequency(&ticksPerSecond); //Calculate per uSec freq double uFreq = ticksPerSecond.QuadPart/uSec; // Get counter b4 start of op QueryPerformanceCounter(&tick_1); // The ope itself Sleep(10); // Get counter after opfinished QueryPerformanceCounter(&tick_2); // And now the op time in uSec double diff = (tick_2.QuadPart/uFreq) - (tick_1.QuadPart/uFreq);

    Read the article

  • Calculate minimum moves to solve a puzzle

    - by Luke
    I'm in the process of creating a game where the user will be presented with 2 sets of colored tiles. In order to ensure that the puzzle is solvable, I start with one set, copy it to a second set, then swap tiles from one set to another. Currently, (and this is where my issue lies) the number of swaps is determined by the level the user is playing - 1 swap for level 1, 2 swaps for level 2, etc. This same number of swaps is used as a goal in the game. The user must complete the puzzle by swapping a tile from one set to the other to make the 2 sets match (by color). The order of the tiles in the (user) solved puzzle doesn't matter as long as the 2 sets match. The problem I have is that as the number of swaps I used to generate the puzzle approaches the number of tiles in each set, the puzzle becomes easier to solve. Basically, you can just drag from one set in whatever order you need for the second set and solve the puzzle with plenty of moves left. What I am looking to do is after I finish building the puzzle, calculate the minimum number of moves required to solve the puzzle. Again, this is almost always less than the number of swaps used to create the puzzle, especially as the number of swaps approaches the number of tiles in each set. My goal is to calculate the best case scenario and then give the user a "fudge factor" (i.e. 1.2 times the minimum number of moves). Solving the puzzle in under this number of moves will result in passing the level. A little background as to how I currently have the game configured: Levels 1 to 10: 9 tiles in each set. 5 different color tiles. Levels 11 to 20: 12 tiles in each set. 7 different color tiles. Levels 21 to 25: 15 tiles in each set. 10 different color tiles. Swapping within a set is not allowed. For each level, there will be at least 2 tiles of a given color (one for each set in the solved puzzle). Is there any type of algorithm anyone could recommend to calculate the minimum number of moves to solve a given puzzle?

    Read the article

  • How to calculate the time difference between two time fields , with respect to the date changes

    - by Tiru
    I want to calculate the time difference.I have three EditTexts , I want to input the times in the first two edittexts in HH:MM format. And then calculate the time difference and the result will show on third edittext field in same format. If the date changes, the time difference will calculate according that, i.e If first time = 23:00 and second time = 01:00 then, the time difference = 02:00 hours public class TimeCalculate extends Activity { private String mBlock; private String mBlockoff; private String mBlockon ; // String mHours, mMinutes; Date date1, date2; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); EditText blockoff = (EditText) findViewById(R.id.blockoff); mBlockoff = blockoff.getText().toString(); EditText blockon = (EditText) findViewById(R.id.blockon); mBlockon = blockon.getText().toString(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("hh:mm"); try { date1 = simpleDateFormat.parse(mBlockoff); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { date2 = simpleDateFormat.parse(mBlockon); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } mBlock = getDifference(date1, date2); EditText block = (EditText) findViewById(R.id.block); block.setText(mBlock.toString()); } public static String getDifference(Date startTime, Date endTime) { if (startTime == null) return "corrupted"; Calendar startDateTime = Calendar.getInstance(); startDateTime.setTime(startTime); Calendar endDateTime = Calendar.getInstance(); endDateTime.setTime(endTime); long milliseconds1 = startDateTime.getTimeInMillis(); long milliseconds2 = endDateTime.getTimeInMillis(); long diff = milliseconds2 - milliseconds1; /*int hours = (int)diff / (60 * 60 * 1000); int minutes = (int) (diff / (60 * 1000)); minutes = minutes - 60 * hours; long seconds = diff / (1000); */ //timeDiff = DateUtils.formatElapsedTime(seconds); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH:MM"); Date date = new Date(diff); return simpleDateFormat.format(date); } } I executed this code ,but gives error as Source not found.I think error at getDifference method.Please give any other logic

    Read the article

  • Simple calculation in SQL Server

    - by meep
    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?

    Read the article

  • SAS/R calculate distance between two groups

    - by user976856
    I would like to calculate distance between two groups. I am very confused. I have a two data sets. One is about a company and one is about employees. I would like to find out how their age( a company in which an employee is hired and an employee) are similar or not. I think I need to standarize also.. calcuate euclidean distance between each person and a company. (4-5 people in a company) calculate euclidean distance between each person and a company in industry level. My dataset is like this: person person_age company company_age insustry 1 50 1 5 1 2 40 1 5 1 3 30 2 1 1 4 20 2 1 1 5 25 3 8 2 Please help me. I don't mind using SAS or R. I am very confused.

    Read the article

  • How do I make JavaScript to set these element values?

    - by dmanexe
    I have two fields that need to multiply each other and fill a 3rd form's value. Here's the HTML: <input type="text" name="estimate[concrete][price]" value="" onBlur="calc_concreteprice(document.forms.mainform);" /> per SF <strong>times</strong> <input type="text" name="estimate[concrete][sqft]" value="" onBlur="calc_concreteprice(document.forms.mainform);" /> SF = <input type="text" name="estimate[concrete][quick_total]" value="" /> Here's my JavaScript: function calc_concreteprice(mainform) { var oprice; var ototal; oprice = ((mainform.estimate[concrete][sqft].value) * (mainform.estimate[concrete][price].value)); ototal = (oprice); mainform.estimate[concrete][quick_total].value = ototal; } I want the first two forms to be multiplied together and output to the third. I think my problem may be within how I am referencing the input field names, with brackets (I'm taking results from this form as an array so I'm already used to working with the results as a multi-dimensional array). Thanks for the help!

    Read the article

  • How to take some values and + them together with PHP.

    - by Kyle Sevenoaks
    Hi, I am having a problem. I have some prices in a checkout displayed, they are "discount prices." How can I get these values from my page and add them together to display in a new div? I have two prices for two products 1000 and 2000, I want to be able to add these together to make 3000 and display it as a total in a new div. Example of what I'm going for here. Thanks :) (Also, is there a php site similar to JSfiddle?)

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >