Windows 10: Random Number Generation

Discus and support Random Number Generation in Windows 10 Customization to solve the problem; I'm writing a jukebox in Visual Studio vb.net. I'm attempting to utilise random number generators to swap the image of the record label being played... Discussion in 'Windows 10 Customization' started by GraemeFBaillie, Feb 12, 2020.

  1. Random Number Generation


    I'm writing a jukebox in Visual Studio vb.net. I'm attempting to utilise random number generators to swap the image of the record label being played which works fine


    Dim r As New System.RandomCTypeSystem.DateTime.Now.Ticks Mod System.Int32.MaxValue, Integer

    Public Function GetRandomNumberOptional ByVal Low As Integer = 1, Optional ByVal High As Integer = 100 As Integer
    ' Returns a random number, between the optional Low and High parameters
    Return r.NextLow, High + 1

    End Function

    gRecordLabelImage = gDefaultLabelImageGetRandomNumber0, gDefaultLabelImageCount - 1

    However, when trying to utilise this code to get the next 5 records to be played when implementing random play, the code calls work first time through but give me the same 5 random numbers on the next call.


    For LoopCounter = 1 To 5

    Counter = GetRandomNumber1,TracksDataSet.Count - 1

    gTrackFileName = TracksDataSetCounter.PlayListTrackFileName

    Next


    I've tried RNGCryptoService Provider


    Dim Provider As New RNGCryptoServiceProvider

    Public Function GenerateRandomByRef MaxValue As Integer As Integer
    Dim result As Integer

    Using Provider
    Dim data As Byte = New Byte3 {}
    Provider.GetBytesdata
    result = BitConverter.ToUInt32data, 0 Mod MaxValue + 1
    End Using

    Return Result

    End Function

    For LoopCounter = 1 to 5

    Counter = GenerateRandomTracksDataSet.Count

    gTrackFileName = TracksDataSetCounter.PlayListTrackFileName

    Next

    But this does exactly the same. Please note though that the 5 repeated random numbers are different every time code is started, they just repeat while code is running.


    I've worn myself out in Google and web forums - they all say the same - the code should work, so what is my problem. Any Help gratefully accepted


    thanks - Graeme Baillie

    :)
     
    GraemeFBaillie, Feb 12, 2020
    #1

  2. Generating Random Numbers (Need help ASAP!)

    Working on a math problem.

    • First, I need to generate a random integer from 1 to 6. I need to keep doing this until I get the number 3. I need to record how many numbers had to be generated.
    • Second, I need to generate random integers from 1 to 6 until I have picked every number once. Again, I need to know how many numbers were generated.
    I need to do each situation a certain number of times (which is up to me) to get an average of how many numbers had to be generated in order to meet the condition.

    Being the overachiever that I am, I'd like to generate an absurd number of trials. So I want to do the first situation a huge number of times and then get the average. Same for situation 2. Is there any way I could use my computer to do this? My Q6600 is on Windows and my 2GHz Core Duo laptop runs Ubuntu.
     
    angelkiller, Feb 12, 2020
    #2
  3. Generating Random Numbers (Need help ASAP!)

    Hm. Its almost 2 here so for the sake of simplicity, I'll just use my calculator.

    Edit 1: Ok, got the first one done. TI-83 is slooow. Does ~2.3 trials/sec. Takes 7 min for 1000.

    Working on 2nd one now. 2:30am and counting.

    Edit 2: I gotta stop, it's too late. I'm having problems with the second program. First I fill a list with six zeros. Then, I make a random integer 1-6. I store it in a list to it's corresponding index. So if the random number was 1 then it gets stores in L1(1). An index with a value of 0 means that index has not been chosen yet.

    I'm having trouble getting the checking loops to work. No time to explain it now, but basically the checking loops go like this. Check L1(1) for value of 0. If true, stop checking and go back to generating random numbers. If L1(1) is not zero check L1(2). (and so on) If L1(6) is not zero, break from all loops and display how many times the main while loop ran.

    Tomorrow is gonna suck. I don't do well with little sleep. *Bang Head :banghead:
     
    angelkiller, Feb 12, 2020
    #3
  4. Brink Win User

    Random Number Generation

    Windows 10 pseudo random number generator infrastructure white paper

    Source: https://www.microsoft.com/security/b...nfrastructure/
     
    Brink, Feb 12, 2020
    #4
Thema:

Random Number Generation

Loading...
  1. Random Number Generation - Similar Threads - Random Number Generation

  2. PC crashes randomly but do not generate minidump or MEMORY.dmp

    in Windows 10 Gaming
    PC crashes randomly but do not generate minidump or MEMORY.dmp: Hello, Following up from this thread : https://answers.microsoft.com/en-us/windows/forum/windows_10-performance/pc-crashes-when-connected-to-a-different-tv-and/2e64cc3d-0a1e-48e6-9aeb-a28b8dad13d6?page=1As you can read in this thread I got help before trying to fix my issues...
  3. PC crashes randomly but do not generate minidump or MEMORY.dmp

    in Windows 10 BSOD Crashes and Debugging
    PC crashes randomly but do not generate minidump or MEMORY.dmp: Hello, Following up from this thread : https://answers.microsoft.com/en-us/windows/forum/windows_10-performance/pc-crashes-when-connected-to-a-different-tv-and/2e64cc3d-0a1e-48e6-9aeb-a28b8dad13d6?page=1As you can read in this thread I got help before trying to fix my issues...
  4. Random Number and Letter Files

    in AntiVirus, Firewalls and System Security
    Random Number and Letter Files: Hello, in my Windows 10 PC keeps appearing random files. I delete them then they reappear, I downloaded some anti-virus programs and hard drive cleaning software, but it doesn't work, I need help. These are the files :Most of are empty and have appeared recently.Thank you,...
  5. Random STREAM wav file generated

    in Windows 10 Network and Sharing
    Random STREAM wav file generated: Hello, a program seems to automatically generate STREAM_X.wav file periodically to C:\ drive in the background. Here's a screenshot of it: [ATTACH] Is it a sign of a malware? What should I do to stop the program? Thanks....
  6. Solitaire Freecell Random Number Generator in Windows 10

    in Windows 10 BSOD Crashes and Debugging
    Solitaire Freecell Random Number Generator in Windows 10: I have stopped playing Freecell set to "Expert" on Windows 10 because the "random" numbers are all games that I have completed within the last twelve months....
  7. Randomly numbered network adapters?

    in Windows 10 Network and Sharing
    Randomly numbered network adapters?: Windows Version 1909 Why do these network adapters not start from #1 and from #2 or #3 instead? [img] What are the Microsoft direct adapters used for? - - - Updated - - - I installed Vmware workstation and uninstalled it, it got rid of all 3 Microsoft network adapters...
  8. Windows 10 pseudo random number generator infrastructure white paper

    in Windows 10 News
    Windows 10 pseudo random number generator infrastructure white paper: Throughout the years, we’ve had ongoing conversations with researchers, developers, and customers around our implementation of certain security features within the Windows operating system. Most recently, we have open-sourced our cryptography libraries as a way to contribute...
  9. Random Green Colored Numbers

    in Windows 10 BSOD Crashes and Debugging
    Random Green Colored Numbers: When I opened the start menu some random green colored numbers started appearing on the start tiles and also my account image. Also when I opened the Get Help app I found that the app was also showing those numbers The font is similar to Nvidia's font style which shows fps...
  10. Randomly generated hidden folders in the Users directory.

    in Windows 10 Network and Sharing
    Randomly generated hidden folders in the Users directory.: Hello, there are these weird user folders getting generated in the Users folder, they seem to delete themselves and regenerate every day and I have no idea what they are or for, is it for Windows Update? The names of this files are weird too like angels-wore.sql...