random

    2熱度

    1回答

    答案顯然是yes在Java實現,但如何Org.BouncyCastle.Security.SecureRandom在C#中?

    3熱度

    1回答

    如Random number generator only generating one random number所述,每當您需要另一個隨機數時,創建System.Random的新實例通常是不正確的,因爲System.Random是基於時鐘播種的,因此在同一個tick中創建的多個實例將產生相同的隨機數。因此,一種常見做法(至少在單線程應用程序中)是創建存儲在用於所有隨機數生成的靜態字段中的單個實

    1熱度

    1回答

    我非常喜歡編程(C#),我有一個學校作業是編寫經典遊戲戰艦的簡化版本。 我都在數組看起來像這樣的船,和一類(船): public Ship(Texture2D shipsheet, Rectangle hitbox, Rectangle sourceRectangle, bool rotated) 我覺得問題是,for循環是不承認的船舶需要不同的布爾,就像它只讀一次那條線?但是,它不應該,對吧

    1熱度

    1回答

    我已經通過一些鏈接的幫助,在這個網站上創建一個存儲過程如下: How to insert Huge dummy data to Sql server What is the most efficient way to generate 8 character random alphanumeric string in TSQL? 我的存儲過程: IF EXISTS (SELECT 1 FROM d

    1熱度

    1回答

    我試圖讓情侶隨機陣列與numpy.random.poisson。我想按照它們生成的順序保存每個數據集。現在我正在使用列表來做這件事,我想知道是否有更好的方法來做到這一點,事後可以輕鬆訪問每一組? 這是我的代碼: import numpy as np data = np.random.randint(0, 255, (250, 250, 3)) total = np.zeros(data.sha

    -1熱度

    2回答

    我需要在for循環中生成統一的隨機數。 for循環用於1000000個數字。還有另一個for循環,它在2000裏面。所以我生成了2 * 10^9的統一隨機數。我用下面的方法: #include <random> double zeta; unsigned seed = std::chrono::system_clock::now().time_since_epoch().cou

    0熱度

    2回答

    import random avchars = ['a','b','c','d','e','f','g'] ra = random.randint(8,24) rb = random.randint(1,7) for i in range(ra): file = open("pass","w") ac = avchars(rb) print(ac)

    1熱度

    1回答

    我有下面的代碼(從here mookhed)隨機化1500個值的向量,我想將它們放在一個文本文件,但不能。老實說,我不完全理解這段代碼是如何工作的,所以我希望有人向我解釋它是如何工作的和/或如何將輸出更改爲文件。 #include <iostream> #include <random> #include <algorithm> #include <iterator> #include <

    2熱度

    1回答

    我與社區生態學一起工作,我試圖隨機化我的矩陣〜999次,併爲這999次中的每一次提取beta多樣性值。這將有希望給我一個空分佈來比較我的實際值。但是,我正在運行一個循環功能來執行此操作非常困難。 因此,這裏的一些示例數據: com.dat<-matrix(c(10,0,0,0,5,0, 0,3,4,0,0,9, 0,0,8,6,0,0, 7,0,9,0,0,0, 5,3,2,2,1,2),nro

    1熱度

    1回答

    隨機數的相關名單,我有以下的代碼生成一些隨機數字:但是 import random random.seed(1) lambdaj = [] tauj = [] for i in range(30): lambdaj.append(random.randint(2, 15)) tauj.append(random.uniform(10/365, 40/365))