percentage

Limiting certain processes to CPU % - Linux

Hi! I have the following problem: some processes, generated dynamically, have a tendency to eat 100% of CPU. I would like to limit all the process matching some criterion (e.g. process name) to a certain amount of CPU percentage. The specific problem I'm trying to solve is harnessing folding@home worker processes. The best solution I c...

Algorithm to keep a list of percentages to add up to 100%

(code examples are python) Lets assume we have a list of percentages that add up to 100: mylist = [2.0, 7.0, 12.0, 35.0, 21.0, 23.0] Some values of mylist may be changed, others must stay fixed. Lets assume the first 3 (2.0, 7.0, 12.0) must stay fixed and the last three (35.0, 21.0, 23.0) may be changed. fix = mylist[:3] vari =...

Why does the Standard Numeric Format for percentages include a space?

The Back Story I have some decimal values which I am displaying as strings on a web page as part of a larger string. I started off using a http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx]">Standard Numeric Format String to output this. E.g. myDecimal.ToString("P0") The 0 after the P tells it I want no decimal places. This works...

How do I compute a win/loss percentage in Visual Basic?

Huge noob here trying to teach himself VB. I need to compute the percentage of games won and games lost. I keep getting errors and it's driving me up a wall. I've changed my code so many times that I don't really remember what it was like when I started. Any help would be greatly appreciated, Thanks in advance. Private Sub btnPercentage...

VB.Net Compute Tips For Services Rendered. Beginner.

The program should request the person’s occupation, the amount of the bill, and the percentage tip as input and pass this information to a Sub procedure to display the person and the tip. Title is gratuities, first line Person’s occupation, amount of the bill:, Percentage tip: Compute Tip, and show the tip. Im not sure how to approach it...

Increment, decrement by percentage

I'll try to explain this problem the best way i can with code: double power = 5000; //picked up 5 power ups, now need to increase power by 10% per powerup power += 5 * (power * .10); //later on...ran into 5 power downs need to decrease power back to initial hp power -= 5 * (power * .10);//7500 - 3750 -- doesn't work So what i need i...

What are these called <% ... %>? And what ways can they be used in a page.

In a .Net web form... What are these special tags called? I know of 2: <%-- comment --%> for comments and <%# used with Eval and Bind #> So what does the # signify? Are there more? I know you can put some basic logic and function calls in there but I've never found anything that really describes how that can be used and should be...

How to format a number as percentage without the percentage sign?

How do I in .NET format a number as percentage without showing the percentage sign? If I have the number 0.13 and use the format string {0:P0} the output is 13 %. However I would like to get 13 instead, without having to multiply the number by 100 and using the format string {0:N0}. (Background: In ASP.NET I have a GridView with a Bou...

Console based progress in Java

Is there are easy way to implement a rolling percentage for a process in Java, to be displayed in the console? I have a percentage data type (double) I generated during a particular process, but can I force it to the console window and have it refresh, instead of just printing a new line for each new update to the percentage? I was think...

As a software developer, what kind of percentage commission do you expect from a company that licenses your product?

As a software developer, what kind of percentage commission do you expect from a company that licenses your product? In other words, if you create an application for a run-time engine and that firm gets to sell seats to run your product, what kind of percentages do you think are fair commissions? ...

SQL: SELECT n% with pictures, (100-n)% without pictures

Hi all, we have a DB which stores users who may have pictures. I am looking for an elegant way in SQL to get the following results: Select n users. Of those n users e.g. 60% should have an associated picture and 40% should not have a picture. If there are less than 60% users having a picture the result should be filled up with users wi...

How to get the current view size for an image in Delphi 2009

I wish to get the current size for an image being displayed with TImage, this object has the Proportional property set to True and is aligned to Client with main form. So, when resizing the form I wanna get the current size for that image, not canvas size neither real size for that image. Getting the current size I can show what's the pe...

Get percentage average

I'm unsure how to go about this either because it late, or I'm a MySQL noob (probably both to be honest). I have a table called 'poll_votes' which comprises of: ID, poll_id, answer_id, ip, time_posted What I need to do, is for each unique answer_id in a specific poll_id, calculate the percentage out of the total number of answers th...

Calculating the percentage difference between two values

Before you start laughing at such a simple question let me explain: I am trying to determine how much change (percentage %) there is in an account over various indicators. This is not particularly hard. But how do you generally handle the cases where the current value is zero or the previous value is zero? i.e. This week: Earnings ...

Rounding an arrays of values to 100%

Hi all, I have an dictionary of lists of objects as shown below: IDictionary<string, IList> MyItemDictionary I work out the percentages by doing a for each through the dictionary with the code below: IList<double> percentages = new List<double>(); foreach(KeyValuePair<string, IList> pair in MyItemDictionary) { double percen...

shortening javascipt number

Hello , I am looking for an efficient way to cut floating number at Javascript which are long. I need this because my output for taking percentage of two numbers can be sometimes like 99.4444444 while I am only interested in the first 2 digits after "." such as 99.44 My current percentage taking function for 2 numbers: function takePe...

MySQL % question

I'm working with survey data. Essentially, I want to count total responses for a question for a location, then use that total to create what percentage of all responses each particular response is. I then want to group results by location. An ideal output would be similar to this: Q1 | State | City | % yes| MA | bos |10 no | MA ...

C++ What does the percentage sign mean?

I got this c++ macro and wonder what they mean by code%2 (the percentage sign) ? #define SHUFFLE_STATEMENT_2(code, A, B) switch (code%2) { case 0 : A; B; break; case 1 : B; A; break; } ...

Getting a percentage from MySql with a group by condition, and precision

I was about to ask the MySql list this and remembered about SO. Running MySql 5.0.85, I need to be as efficient as possible about a few queries. If I could get a little review, I would appreciate it. I collect data in the millions, and need the top 50 grouped by one field, with a percentage of how much those top 50 occupy. Here is wh...

What should be the best way to store a percent value in SQL-Server?

Hello! I want to store a value that represents a percent in SQL server, what data type should be the prefered one? ...