|
define better.
Is it better image quality on playback? Smaller file size? Lower CPU load during playback? Lower CPU load during encoding? More resistant to bit rot without total failure?
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
<b>How can i print 1 to 10 with minimum number of if condition?
Note: With out using loop and goto.</b>
Chandan Dey
|
|
|
|
|
printf("1 2 3 4 5 6 7 8 9 10");
Zero if conditions, no loops
|
|
|
|
|
This is clearly homework people. You should know better.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
Indeed i should!
I'm getting too frustrated with my algorithm that "So Nearly" works that i felt like solving something simpler. I hadn't really considered the source of the puzzle.
I stand chastised.
Russell
|
|
|
|
|
|
no loop, and no goto as requirements are something that would only make sense in the context of a cheater trying to avoid doing his schoolwork. Such posts should be answered with a LARTing, not a proper solution.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
I believe Michael was handling the situation admirably.
And I guess he knew what he was posting...
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
shouldnt that be
printf("1 to 10");
?
Luc Pattyn
|
|
|
|
|
public void PrintUpToNumber(int StartNumber, int EndNumber)<br />
{<br />
Console.WriteLine(StartNumber);<br />
if(StartNumber < EndNumber) PrintUpToNumber(StartNumber+1,EndNumber);<br />
}
Something like that?
Russ
|
|
|
|
|
$intelligent-linux: Hey!
Yes dear user?
$intelligent-linux: Someone on codeproject forums came up with this weird problem
Tell me about it....
$intelligent-linux: Well, the guy wanted some numbers printed without using loops and stuff
So? what's the big deal?
$intelligent-linux: I think he was on Windows
There you go........So what happened finally?
$intelligent-linux: Nothing, I was just wondering if it can be done without loops and stuff
Watch this........1 2 3 4 5 6 7 8 9 10
$intelligent-linux: Oh my god, those were the numbers he mentioned there!!! How did you know?
Welcome to the linux shell dearie, this is where God speaks.
:->
ASP - AJAX is SEXY. PERIOD.
|
|
|
|
|
That's not the minimum number of if-conditions, you can do it with 0 (at least in C++):
template<int n>
void printUntil10() {
cout << n << endl;
printUntil10<n+1>();
}
template<>
void printUntil10<10>() {
cout << 10 << endl;
}
int main() {
printUntil10<1>();
return 0;
}
|
|
|
|
|
while (ain't between 1 and 10)
don't
{
print number y'all;
}
I am a SysAdmin, I battle my own daemons.
|
|
|
|
|
Hi,
I was looking at the "Solver Platform SDK" from Frontline Systems, Inc (
http://www.solver.com/technology2.htm#Primal%20and%20Dual%20Simplex%20Method)
as a way to do some optimization problems in an application, but their licensing seems rather complicated and expensive. Does anybody know of a cheaper alternative product and/or can somebody suggest a good introduction to the primal and dual simplex method so that I might look into rolling my own?
Thanks.
|
|
|
|
|
I'm not sure if it's what you're after but perhaps uBLAS[^] (or BLAS) can help.
Steve
|
|
|
|
|
Hi Wjousts,
most likely TOMNET (the TOMNET Optimization Platform for .NET: http://tomopt.com/tomnet/ ) is something for you.
TOMNET solves linear, quadratic and linear least squares problems (and more), so you'll go well armed in the world of optimization .
Sample code, mathematical formulation and syntax for a linear programming (optimization) problem is found here: http://tomopt.com/docs/tomnet_quickguide/tomnet_quickguide003.php
TOMNET also comes as a free 21 day demo so you can try it at no cost.
HTH,
/Per
--
Per Strandberg
.NET Architect - Optimization
Tomlab Optimization Inc.
http://tomopt.com/tomnet/
|
|
|
|
|
Hi!
I have follwing sequence of integers ...
1,3,4,5,9,12,13,14,15,17,19,20,21,22,23,24,30
i want to group above integers as
1,3-5,9,12-15,17,19-24,30
can any one suggest an algo.?
Thanks & Regards,
SAMir Nigam,
Software Developer,
STPL, Lucknow, India.
|
|
|
|
|
Just check if the next number minus current equals 1 and append -. Then replace ---- with -. However, I always liked seeing 1, 3, 4, 6 as that and not 1, 3-4, 6.
|
|
|
|
|
Hi all.
I write class to handel the big integer number problem, but my division algorithm is to weak. if I wont to divid 'a' into 'b' I must get the bite code of 'a','b' and divide this numebr by using this bite code. it take tol of time and this algoritm works on integer number only.I wont to solwe this two problem.
Can some one help me and give better algorithm or tel where I can find it.
Thanks for any help.
|
|
|
|
|
Doing division efficiently is not very straightforward; there are many algorithms.
You could have a look at:
- some "big integer" articles on CodeProject
- the GNU multi-precision library [^]
- hundreds of books, e.g. The Art of Computer Programming, Volume 2, Seminumerical
Algorithms, by Donald Knuth.
- Google
I myself would be interested in a .NET wrapper for the GNU library, because I work in
.NET and the GNU library is very extensive.
Regards
Luc Pattyn
|
|
|
|
|
Luc Pattyn wrote: I myself would be interested in a .NET wrapper for the GNU library, because I work in
.NET and the GNU library is very extensive.
Is the library released under the GPL, or LGPL?
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
I dont know, but I did include the link...
Luc Pattyn
|
|
|
|
|
Look into MIRACL.
"It is the mark of an educated mind to be able to entertain a thought without accepting it." - Aristotle
Web - Blog - RSS - Math - LinkedIn - BM
|
|
|
|
|
Class Diagram::LongMath<br />
Addition <br />
Add(sourceA As String, sourceB As String) As String<br />
Subtraction <br />
Subtract(sourceA As String, sourceB As String) As String<br />
Multiplication <br />
Multiply(sourceA As String, sourceB As String) As String<br />
Division<br />
Divide(divisor As String, dividend As String) As String
source[^]
I'm listening but I only speak GEEK.
|
|
|
|
|
Hi AreJay,
I was aware of this package, but I didnt mention it since I am not convinced
string representations will lead to good performance.
Most "big integer" packages use arrays of ints or something similar, which
is more computer-friendly.
Regards,
Luc Pattyn
|
|
|
|