Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
My client(from denmark) give the value to use in cost value in php.
He said " Use this , The Cost is 50.000 Dkr half product , 200.000 Dkr. for full product. "
i am confused in comma and dot ? what is correct value ? its 50.000 or 50,000.
This isn't a coding question
Commas are used in the English convention to separate thousands (50,000 = fifty thousand. 50.000 = fifty point zero zero zero)
In Continental Europe commas are used as the decimal separator (50,5 = fifty and a half)
Please do a bit of research before your next question. This one is easily answered here
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I have a table that holds prices, the idea behind it is to have users suggest prices they think are reasonable for a good,example; range
You can divide the price by the range size, and then use FLOOR() to get the beginning of the range:
SELECT 1500*FLOOR(price/1500) AS price_base, COUNT(*) AS count
FROM yourTable
GROUP BY price_base
ORDER BY count DESC
For example, price_base = 3000 contains all prices from 3000 to 4499, while price_base = 4500 contains all prices from 4500 to 5999.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have a property website.
At the moment, on the listing, and in search results, it says Number of bedrooms: [pulls the number from the database]. It uses an array variable, $a1[rooms].
Instead, I want to display a small icon of a bed for the number of bedrooms. So if three bedrooms then it should say, Number of bedrooms: [bed img] [bed img] [bed img]. [bed img] of course being a small icon/image of a bed.
So whether there are 1 bedrooms or 5 bedrooms, this is the number of times I want the icon displayed. The number of bedrooms is stored here: $a1[rooms].
Fairly simple really.
Thanks in advance.
Something like this will do the trick:
for ($bed_counter = 1; $bed_counter <= $a1['rooms']; $bed_counter++) {
print '<img src="bed.jpg">';
}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I found the one of the condition as "All integers in the series will lie in the range
[-10^6,+10^6]" in one of the online test what does it means?
From the Wikipedia page on intervals you can see;
A closed interval includes its endpoints, and is denoted with square brackets. For example [0,1] means greater than or equal to 0 and less than or equal to 1.
10^6 (10 to the power of 6) is the same as 1 million, so All integers in the series will lie in the range
[-10^6,+10^6] means that all numbers in the series are;
Greater than or equal to -1000000 (minus one million)
Less than or equal to 1000000 (one million)
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm building a browser game which you can shoot missiles on factories.
This is example of a similar SQL table:
user_ID iron steel metal gold
1 21 30 39 25
2 7 10 25 50
I need each missile to destroy 1 factory.
For example I shoot 10 missile, so 10 factories are destroyed. But I need it to have completely randomly and even.
The problem is if according to this SQL table, if I shoot for example 40 missile on user_ID '2'.
In best case I destroy 10 factories of each kind. But how can I do it when I don't know if there is enough of each kind?
First, divide the number of missiles by the number of factory types that have at least 1 factory. If all the types have at least this many factories, subtract this from each column.
If any of the types have less than this, they'll be totally wiped out. Reduce them to 0 and subtract their original totals from the number of missiles. Then start again, using just the remaining missiles.
Repeat this until you use up all the missiles or all factories are wiped out.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
suppose I have one array having the values:
array(20,40,30,15,60,50,10)
Now what i want is to I need to create bunch of 100 or near to hundred.and create separate round for each set of 100(or near to 100).
Say
Case 1:
Round 1: array(60,30,10) // 100 or near to 100
Round 2: array(40,50) // 100 or near to 100
Round 3: array(15,20) // 100 or near to 100 or remaining
Case 2:
Round 1: array(60,40) // 100 or near to 100
Round 2: array(50,20,30) // 100 or near to 100
Round 3: array(15,10) // 100 or near to 100 or remaining
So how can I achieve this?
Is there any algorithm regarding this that I can study?
You are describing the binpacking problem, which is NP-Complete, thus there is no known polynomial solution to solve it.
You can try an exponential approach (check all possibilities) if you need exact. If you want "close enough" you can search the literature for some approximation algorithm, or use some heuristic search solution from the AI field such as Genetic Algorithm or Hill Climbing.