|
All can be worked out with a little bit of Google-fu. Type one thing in, 2 clicks and I got this[^]. Weak in the way of the Google are you.
|
|
|
|
|
I don't want to use the random class.
i want to ceate this by my own.
|
|
|
|
|
Don't you think you should have stated that in your original question then? We don't read minds.
|
|
|
|
|
Try this:
Simple Random Number Generation[^]
And, as Peter said, why did you not say this in the original post since it would avoid people telling you to look it up in help.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
treuveni wrote: I don't want to use the random class.
i want to ceate this by my own
Well why didn't you f*ckin say that in your original message? How are we supposed to read your simple little mind when it generates almost no electrical energy on its own?
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997
|
|
|
|
|
John Simmons / outlaw programmer wrote: Well why didn't you f*ckin say that in your original message? How are we
supposed to read your simple little mind when it generates almost no electrical
energy on its own?
f*ck you
|
|
|
|
|
public int GetRandomNumber()
{
return 3;
}
|
|
|
|
|
You'll need a source of randomness and a way to map the output of that source to numbers between your two inputs.
If you want the result to be uniformly chosen from the specified interval, you shouldn't use modulo - that would result in a "first part" where the numbers have a slightly higher chance of being picked then the ones in the "second part".
edit: Ok I just saw your post that you don't want to use the random class, then look up Mersenne Twister and implement that if you want it to be useful, or any simple PRNG if you want something as bad as System.Random or worse.
|
|
|
|
|
|
A couple of points. First of all, you point him to System.Random, and then you send him over to the Java documentation - this is an inconsistent approach. Secondly, he's stated elsewhere in the thread that he wants to roll his own random implementation (it's probably homework). Finally, resources like MSDN are not always the best solution - they tend to be written by tech writers rather than battle hardened developers working with the technologies out in the trenches.
|
|
|
|
|
I apologize. My bad.... And I agree to the MSDN is not always the best but for beginners, it does provide a good start.... After understanding the codes on MSDN they can always try and improvise...
|
|
|
|
|
ankitjoshi24 wrote: Javadoc is the most helpful thing for any java developers. So always visit javadoc and try to find your answers
This is a C# forum... huh?
|
|
|
|
|
i'm using Microsoft.DirectX.AudioVideoPlayback in order to play some videos simultaneous .
i want the user to be able to pick one of the videos as the lead audio and then i mute the others with
video.audio.volume=-10000
normally its working great but if one of the movies dont have audio this action throws exception
how i can know if certain video have audio in it ?
does DirectX.AudioVideoPlayback.video.audio have any property for it?
thanks in advence...
|
|
|
|
|
Can you just check if the Audio property is null ?
/ravi
|
|
|
|
|
thenks for your help , i found an article in msdn that explains that when you try to get audio property from video exception will be throwen if the video has no audio , the sulotion for this problem acordding to msdn is just catch the exception and ignore it...
|
|
|
|
|
|
i need to learn Microsoft Dynamics Development with .net. Actually i don't have any knowledge on the technology and want to learn it. if any body has a know how of the technology then please suggest me some URLs, book, tutorial where from i can learn the technology.
sorry if i have posted question in a wrong forum.....
Regards
|
|
|
|
|
What are you looking to learn? CCA? UII? Workflows? You should probably get started with this[^] book.
|
|
|
|
|
Microsoft Website itself will be good starting point for you...
All the best.
|
|
|
|
|
The OP does not get notified of replies to posts replying to other people. You might want to send this one to the OP instead.
|
|
|
|
|
Hi,
I understand why a class may be static...
In a public class which is NOT static why would there be a static method?
i.e.
public class myCommon
{
public static string GetCurrentDirectory()
{
string path = null;
...
...
return path;
}
}
Thanks
|
|
|
|
|
The static method can be used to create an instance of a class, for instance. Alternatively, the static method does something that does not affect the state of the class so there is no need for it to be an instance method (in other words, all of the variables it uses are local).
|
|
|
|
|
So, what is the difference between the following codes please?
public class myCommon
{
public static string GetCurrentDirectory()
{
string path = null;
...
...
return path;
}
}
public static class myCommon
{
public static string GetCurrentDirectory()
{
string path = null;
...
...
return path;
}
}
|
|
|
|
|
the difference is removing "static" in public static string GetCurrentDirectory() will not/will cause a compiler error message.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
So,
1- A static class should have all it's methods as static.
2- A static class can be referred to without creating an instance of it.
3- If a class is NOT static and one or more of it's methods are static, then those static methods can be referred to without creating an instance but to refer to the non static methods, first, an instance of the class must be created.
Am I right please?
|
|
|
|