Best JavaScript code snippet using wpt
test_random.py
Source:test_random.py
...593 np.testing.assert_array_almost_equal(out1, out2)594 else:595 np.testing.assert_array_equal(out1, out2)596 def test_normal(self):597 def gen_random(state, out):598 out[...] = state.normal(size=10000)599 self.check_function(gen_random, sz=(10000,))600 def test_exp(self):601 def gen_random(state, out):602 out[...] = state.exponential(scale=np.ones((100, 1000)))603 self.check_function(gen_random, sz=(100, 1000))604 def test_multinomial(self):605 def gen_random(state, out):606 out[...] = state.multinomial(10, [1/6.]*6, size=10000)607 self.check_function(gen_random, sz=(10000,6))608if __name__ == "__main__":...
create_crime_data_csv.py
Source:create_crime_data_csv.py
1############ create crime data as csv ############2import random3# create file4f = open("crime_data.csv", "w")5# save label6f.write("Type" + ", " + "Date-Time" + ", " + "Latitude" + ", " + "Longitude" + "\n")7############################# random #############################8# create Theft data (1050)9for i in range(2, 1052):10 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))11 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))12 f.write("Theft" + ", " + 13 str(date) + " " + str(time) + ", " + 14 str(random.uniform(37.5546645, 37.56886886)) + ", " + 15 str(random.uniform(126.96777894, 127.0176931)) + "\n")16# create Assault data (950)17for i in range(1052, 2002):18 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))19 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))20 21 f.write("Assault" + ", " + 22 str(date) + " " + str(time) + ", " + 23 str(random.uniform(37.5546645, 37.56886886)) + ", " + 24 str(random.uniform(126.96777894, 127.0176931)) + "\n")25# create Sexaul Harassment data (100)26for i in range(2002, 2102):27 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))28 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))29 30 f.write("Sexaul Harassment" + ", " + 31 str(date) + " " + str(time) + ", " + 32 str(random.uniform(37.5546645, 37.56886886)) + ", " + 33 str(random.uniform(126.96777894, 127.0176931)) + "\n")34############################# 2 #############################35# create Theft data (180)36for i in range(0, 180):37 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))38 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))39 f.write("Theft" + ", " + 40 str(date) + " " + str(time) + ", " + 41 str(random.uniform(37.5492475, 37.5545530)) + ", " + 42 str(random.uniform(126.9916576, 127.0143248)) + "\n")43# create Assault data (160)44for i in range(0, 160):45 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))46 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))47 48 f.write("Assault" + ", " + 49 str(date) + " " + str(time) + ", " + 50 str(random.uniform(37.5492475, 37.5545530)) + ", " + 51 str(random.uniform(126.9916576, 127.0143248)) + "\n")52# create Sexual Harassment data (20)53for i in range(0, 20):54 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))55 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))56 57 f.write("Sexaul Harassment" + ", " + 58 str(date) + " " + str(time) + ", " + 59 str(random.uniform(37.5492475, 37.5545530)) + ", " + 60 str(random.uniform(126.9916576, 127.0143248)) + "\n")61############################# 3 #############################62# create Theft data (115)63for i in range(0, 115):64 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))65 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))66 f.write("Theft" + ", " + 67 str(date) + " " + str(time) + ", " + 68 str(random.uniform(37.5573879, 37.5708829)) + ", " + 69 str(random.uniform(127.0175972, 127.0233386)) + "\n")70# create Assault data (100)71for i in range(0, 100):72 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))73 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))74 75 f.write("Assault" + ", " + 76 str(date) + " " + str(time) + ", " + 77 str(random.uniform(37.5573879, 37.5708829)) + ", " + 78 str(random.uniform(127.0175972, 127.0233386)) + "\n")79# create Sexual Harassment data (15)80for i in range(0, 15):81 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))82 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))83 84 f.write("Sexaul Harassment" + ", " + 85 str(date) + " " + str(time) + ", " + 86 str(random.uniform(37.5573879, 37.5708829)) + ", " + 87 str(random.uniform(127.0175972, 127.0233386)) + "\n")88############################# 4 #############################89# create Theft data (45)90for i in range(0, 45):91 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))92 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))93 f.write("Theft" + ", " + 94 str(date) + " " + str(time) + ", " + 95 str(random.uniform(37.5544505, 37.5598302)) + ", " + 96 str(random.uniform(126.9621857, 126.9678786)) + "\n")97# create Assault data (40)98for i in range(0, 40):99 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))100 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))101 102 f.write("Assault" + ", " + 103 str(date) + " " + str(time) + ", " + 104 str(random.uniform(37.5544505, 37.5598302)) + ", " + 105 str(random.uniform(126.9621857, 126.9678786)) + "\n")106# create Sexual Harassment data (5)107for i in range(0, 5):108 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))109 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))110 111 f.write("Sexaul Harassment" + ", " + 112 str(date) + " " + str(time) + ", " + 113 str(random.uniform(37.5544505, 37.5598302)) + ", " + 114 str(random.uniform(126.9621857, 126.9678786)) + "\n")115############################# 5 #############################116# create Theft data (36)117for i in range(0, 36):118 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))119 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))120 f.write("Theft" + ", " + 121 str(date) + " " + str(time) + ", " + 122 str(random.uniform(37.5438144, 37.5492054)) + ", " + 123 str(random.uniform(127.0052766, 127.0098404)) + "\n")124# create Assault data (32)125for i in range(0, 32):126 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))127 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))128 129 f.write("Assault" + ", " + 130 str(date) + " " + str(time) + ", " + 131 str(random.uniform(37.5438144, 37.5492054)) + ", " + 132 str(random.uniform(127.0052766, 127.0098404)) + "\n")133# create Sexual Harassment data (4)134for i in range(0, 4):135 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))136 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))137 138 f.write("Sexaul Harassment" + ", " + 139 str(date) + " " + str(time) + ", " + 140 str(random.uniform(37.5438144, 37.5492054)) + ", " + 141 str(random.uniform(127.0052766, 127.0098404)) + "\n")142############################# 6 #############################143# create Theft data (30)144for i in range(0, 30):145 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))146 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))147 f.write("Theft" + ", " + 148 str(date) + " " + str(time) + ", " + 149 str(random.uniform(37.5509521, 37.5545297)) + ", " + 150 str(random.uniform(126.9859963, 126.9916777)) + "\n")151# create Assault data (27)152for i in range(0, 27):153 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))154 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))155 156 f.write("Assault" + ", " + 157 str(date) + " " + str(time) + ", " + 158 str(random.uniform(37.5509521, 37.5545297)) + ", " + 159 str(random.uniform(126.9859963, 126.9916777)) + "\n")160# create Sexual Harassment data (3)161for i in range(0, 3):162 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))163 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))164 165 f.write("Sexaul Harassment" + ", " + 166 str(date) + " " + str(time) + ", " + 167 str(random.uniform(37.5509521, 37.5545297)) + ", " + 168 str(random.uniform(126.9859963, 126.9916777)) + "\n")169############################# 7 #############################170# create Theft data (33)171for i in range(0, 33):172 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))173 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))174 f.write("Theft" + ", " + 175 str(date) + " " + str(time) + ", " + 176 str(random.uniform(37.5527263, 37.5544725)) + ", " + 177 str(random.uniform(126.9735413, 126.9860058)) + "\n")178# create Assault data (29)179for i in range(0, 29):180 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))181 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))182 183 f.write("Assault" + ", " + 184 str(date) + " " + str(time) + ", " + 185 str(random.uniform(37.5527263, 37.5544725)) + ", " + 186 str(random.uniform(126.9735413, 126.9860058)) + "\n")187# create Sexual Harassment data (4)188for i in range(0, 4):189 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))190 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))191 192 f.write("Sexaul Harassment" + ", " + 193 str(date) + " " + str(time) + ", " + 194 str(random.uniform(37.5527263, 37.5544725)) + ", " + 195 str(random.uniform(126.9735413, 126.9860058)) + "\n")196############################# 8 #############################197# create Theft data (15)198for i in range(0, 15):199 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))200 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))201 f.write("Theft" + ", " + 202 str(date) + " " + str(time) + ", " + 203 str(random.uniform(37.5689393, 37.5697908)) + ", " + 204 str(random.uniform(126.9723007, 126.9836303)) + "\n")205# create Assault data (13)206for i in range(0, 13):207 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))208 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))209 210 f.write("Assault" + ", " + 211 str(date) + " " + str(time) + ", " + 212 str(random.uniform(37.5689393, 37.5697908)) + ", " + 213 str(random.uniform(126.9723007, 126.9836303)) + "\n")214# create Sexual Harassment data (2)215for i in range(0, 2):216 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))217 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))218 219 f.write("Sexaul Harassment" + ", " + 220 str(date) + " " + str(time) + ", " + 221 str(random.uniform(37.5689393, 37.5697908)) + ", " + 222 str(random.uniform(126.9723007, 126.9836303)) + "\n")223############################# 9 #############################224# create Theft data (25)225for i in range(0, 25):226 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))227 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))228 f.write("Theft" + ", " + 229 str(date) + " " + str(time) + ", " + 230 str(random.uniform(37.5690853, 37.5699044)) + ", " + 231 str(random.uniform(126.9983472, 127.0176016)) + "\n")232# create Assault data (22)233for i in range(0, 22):234 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))235 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))236 237 f.write("Assault" + ", " + 238 str(date) + " " + str(time) + ", " + 239 str(random.uniform(37.5690853, 37.5699044)) + ", " + 240 str(random.uniform(126.9983472, 127.0176016)) + "\n")241# create Sexual Harassment data (4)242for i in range(0, 4):243 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))244 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))245 246 f.write("Sexaul Harassment" + ", " + 247 str(date) + " " + str(time) + ", " + 248 str(random.uniform(37.5690853, 37.5699044)) + ", " + 249 str(random.uniform(126.9983472, 127.0176016)) + "\n")250############################# 10 #############################251# create Theft data (21)252for i in range(0, 21):253 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))254 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))255 f.write("Theft" + ", " + 256 str(date) + " " + str(time) + ", " + 257 str(random.uniform(37.5600986, 37.5727126)) + ", " + 258 str(random.uniform(127.0232410, 127.0244540)) + "\n")259# create Assault data (19)260for i in range(0, 19):261 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))262 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))263 264 f.write("Assault" + ", " + 265 str(date) + " " + str(time) + ", " + 266 str(random.uniform(37.5600986, 37.5727126)) + ", " + 267 str(random.uniform(127.0232410, 127.0244540)) + "\n")268# create Sexual Harassment data (2)269for i in range(0, 2):270 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))271 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))272 273 f.write("Sexaul Harassment" + ", " + 274 str(date) + " " + str(time) + ", " + 275 str(random.uniform(37.5600986, 37.5727126)) + ", " + 276 str(random.uniform(127.0232410, 127.0244540)) + "\n")277############################# 11 #############################278# create Theft data (12)279for i in range(0, 12):280 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))281 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))282 f.write("Theft" + ", " + 283 str(date) + " " + str(time) + ", " + 284 str(random.uniform(37.5619098, 37.5655062)) + ", " + 285 str(random.uniform(127.0244196, 127.0267064)) + "\n")286# create Assault data (11)287for i in range(0, 11):288 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))289 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))290 291 f.write("Assault" + ", " + 292 str(date) + " " + str(time) + ", " + 293 str(random.uniform(37.5619098, 37.5655062)) + ", " + 294 str(random.uniform(127.0244196, 127.0267064)) + "\n")295# create Sexual Harassment data (1)296for i in range(0, 1):297 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))298 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))299 300 f.write("Sexaul Harassment" + ", " + 301 str(date) + " " + str(time) + ", " + 302 str(random.uniform(37.5619098, 37.5655062)) + ", " + 303 str(random.uniform(127.0244196, 127.0267064)) + "\n")304############################# 12 #############################305# create Theft data (6)306for i in range(0, 6):307 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))308 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))309 f.write("Theft" + ", " + 310 str(date) + " " + str(time) + ", " + 311 str(random.uniform(37.5709116, 37.5717914)) + ", " + 312 str(random.uniform(127.0187169, 127.0232510)) + "\n")313# create Assault data (5)314for i in range(0, 5):315 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))316 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))317 318 f.write("Assault" + ", " + 319 str(date) + " " + str(time) + ", " + 320 str(random.uniform(37.5709116, 37.5717914)) + ", " + 321 str(random.uniform(127.0187169, 127.0232510)) + "\n")322# create Sexual Harassment data (0)323#for i in range(0, 0):324# date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))325# time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))326# 327# f.write("Sexaul Harassment" + ", " + 328# str(date) + " " + str(time) + ", " + 329# str(random.uniform(37.5709116, 37.5717914)) + ", " + 330# str(random.uniform(127.0187169, 127.0232510)) + "\n")331############################# 13 #############################332# create Theft data (6)333for i in range(0, 6):334 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))335 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))336 f.write("Theft" + ", " + 337 str(date) + " " + str(time) + ", " + 338 str(random.uniform(37.5474326, 37.5492220)) + ", " + 339 str(random.uniform(127.0098079, 127.0120788)) + "\n")340# create Assault data (5)341for i in range(0, 5):342 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))343 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))344 345 f.write("Assault" + ", " + 346 str(date) + " " + str(time) + ", " + 347 str(random.uniform(37.5474326, 37.5492220)) + ", " + 348 str(random.uniform(127.0098079, 127.0120788)) + "\n")349# create Sexual Harassment data (1)350for i in range(0, 1):351 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))352 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))353 354 f.write("Sexaul Harassment" + ", " + 355 str(date) + " " + str(time) + ", " + 356 str(random.uniform(37.5474326, 37.5492220)) + ", " + 357 str(random.uniform(127.0098079, 127.0120788)) + "\n")358############################# 14 #############################359# create Theft data (9)360for i in range(0, 9):361 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))362 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))363 f.write("Theft" + ", " + 364 str(date) + " " + str(time) + ", " + 365 str(random.uniform(37.5473675, 37.5491551)) + ", " + 366 str(random.uniform(126.9939592, 126.9973658)) + "\n")367# create Assault data (7)368for i in range(0, 7):369 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))370 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))371 372 f.write("Assault" + ", " + 373 str(date) + " " + str(time) + ", " + 374 str(random.uniform(37.5473675, 37.5491551)) + ", " + 375 str(random.uniform(126.9939592, 126.9973658)) + "\n")376# create Sexual Harassment data (2)377for i in range(0, 2):378 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))379 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))380 381 f.write("Sexaul Harassment" + ", " + 382 str(date) + " " + str(time) + ", " + 383 str(random.uniform(37.5473675, 37.5491551)) + ", " + 384 str(random.uniform(126.9939592, 126.9973658)) + "\n")385############################# 15 #############################386# create Theft data (12)387for i in range(0, 12):388 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))389 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))390 f.write("Theft" + ", " + 391 str(date) + " " + str(time) + ", " + 392 str(random.uniform(37.5519494, 37.5546495)) + ", " + 393 str(random.uniform(127.0142998, 127.0177351)) + "\n")394# create Assault data (10)395for i in range(0, 10):396 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))397 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))398 399 f.write("Assault" + ", " + 400 str(date) + " " + str(time) + ", " + 401 str(random.uniform(37.5519494, 37.5546495)) + ", " + 402 str(random.uniform(127.0142998, 127.0177351)) + "\n")403# create Sexual Harassment data (2)404for i in range(0, 2):405 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))406 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))407 408 f.write("Sexaul Harassment" + ", " + 409 str(date) + " " + str(time) + ", " + 410 str(random.uniform(37.5519494, 37.5546495)) + ", " + 411 str(random.uniform(127.0142998, 127.0177351)) + "\n")412############################# 16 #############################413# create Theft data (6)414for i in range(0, 6):415 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))416 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))417 f.write("Theft" + ", " + 418 str(date) + " " + str(time) + ", " + 419 str(random.uniform(37.5598616, 37.5616501)) + ", " + 420 str(random.uniform(126.9655664, 126.9678445)) + "\n")421# create Assault data (5)422for i in range(0, 5):423 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))424 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))425 426 f.write("Assault" + ", " + 427 str(date) + " " + str(time) + ", " + 428 str(random.uniform(37.5598616, 37.5616501)) + ", " + 429 str(random.uniform(126.9655664, 126.9678445)) + "\n")430# create Sexual Harassment data (1)431for i in range(0, 1):432 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))433 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))434 435 f.write("Sexaul Harassment" + ", " + 436 str(date) + " " + str(time) + ", " + 437 str(random.uniform(37.5598616, 37.5616501)) + ", " + 438 str(random.uniform(126.9655664, 126.9678445)) + "\n")439############################# 17 #############################440# create Theft data (12)441for i in range(0, 12):442 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))443 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))444 f.write("Theft" + ", " + 445 str(date) + " " + str(time) + ", " + 446 str(random.uniform(37.5526404, 37.5544163)) + ", " + 447 str(random.uniform(126.9610906, 126.9656221)) + "\n")448# create Assault data (10)449for i in range(0, 10):450 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))451 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))452 453 f.write("Assault" + ", " + 454 str(date) + " " + str(time) + ", " + 455 str(random.uniform(37.5526404, 37.5544163)) + ", " + 456 str(random.uniform(126.9610906, 126.9656221)) + "\n")457# create Sexual Harassment data (2)458for i in range(0, 2):459 date = "2019-" + str(random.randrange(1, 13)) + "-" + str(random.randrange(1, 31))460 time = str(random.randrange(0, 24)) + ":" + str(random.randrange(0, 60)) + ":" + str(random.randrange(0, 60))461 462 f.write("Sexaul Harassment" + ", " + 463 str(date) + " " + str(time) + ", " + 464 str(random.uniform(37.5526404, 37.5544163)) + ", " + 465 str(random.uniform(126.9610906, 126.9656221)) + "\n")466# Robber467# Murder468# close file...
emitentes_entrega.factory.js
Source:emitentes_entrega.factory.js
1var faker = require('faker');2module.exports = class EmitentesEntregaFactory {3 4 constructor(estados) {5 6 this.inscricaoEstadual = [7 'ISENTO',8 09 ];10 this.estados = estados;11 this.caixaPostal = [12 '',13 014 ];15 this.linhasProduto = [16 'MC',17 'Roupa',18 'GRÃOS',19 'SOFTWARE',20 'INDUSTRI',21 'TELEFONE',22 'HOSPEDAG',23 'DIVERSOS',24 'TEL/XERO',25 'TRATAMEN',26 'FERRAMEN',27 'EMBALAGE',28 'FORC/LUZ'29 ];30 this.ramosAtividade = [31 'TESTE',32 'RURAL',33 'COMERCIO',34 'INDUSTRIA',35 'CONSUMID',36 'Textil',37 'CAPIROTO',38 'FAB.PROD',39 'Clientes Ext',40 'AGRÃCOLA',41 'Industria',42 '1',43 '009999',44 '11',45 'comercio',46 'CONSUMIDOR',47 'Oi',48 'Rural',49 'rural',50 '12345678',51 'sul',52 'sullll',53 'TRANSPOR'54 ];55 this.dataInicio = new Date(2018, 0, 1);56 this.dataFim = new Date(2018, 12, 31); 57 58 this.bancos = [59 '654',60 '246',61 '025',62 '641',63 '213',64 '019',65 '029',66 '000',67 '740',68 '107',69 '031',70 '739',71 '096',72 '318',73 '752',74 '248',75 '218',76 '065',77 '036',78 '204',79 '394',80 '237',81 '225',82 'M15',83 '208',84 '044',85 '263',86 '473',87 '412',88 '040',89 '745',90 'M08',91 '241',92 'M19',93 '215',94 '756',95 '748',96 '075',97 '721',98 '222',99 '505',100 '229',101 '266',102 '003',103 '083-3',104 'M21',105 '707',106 '300',107 '495',108 '494',109 'M06',110 '024',111 '456',112 '214',113 '001',114 '047',115 '037',116 '039',117 '041',118 '004',119 '265',120 'M03',121 '224',122 '626',123 'M18',124 '233',125 '734',126 'M07',127 '612',128 'M22',129 '063',130 'M11',131 '604',132 '320',133 '653',134 '630',135 '077-9',136 '249',137 'M09',138 '184',139 '479',140 '376',141 '074',142 '217',143 '076',144 '757',145 '600',146 '212',147 'M12',148 '389',149 '746',150 'M10',151 '738',152 '066',153 '243',154 '045',155 'M17',156 '623',157 '611',158 '613',159 '094-2',160 '643',161 '724',162 '735',163 '638',164 'M24',165 '747',166 '088-4',167 '356',168 '633',169 '741',170 'M16',171 '072',172 '453',173 '422',174 '033',175 '250',176 '743',177 '749',178 '366',179 '637',180 '012',181 '464',182 '082-5',183 'M20',184 'M13',185 '634',186 'M14',187 'M23',188 '655',189 '610',190 '370',191 '021',192 '719',193 '755',194 '744',195 '073',196 '078',197 '069',198 '070',199 '092-2',200 '104',201 '477',202 '081-7',203 '097-3',204 '085-x',205 '099-x',206 '090-2',207 '089-2',208 '087-6',209 '098-1',210 '487',211 '751',212 '064',213 '062',214 '399',215 '168',216 '492',217 '652',218 '341',219 '079',220 '488',221 '014',222 '753',223 '086-8',224 '254',225 '409',226 '230',227 '091-4',228 '084'229 ];230 this.countries = [231 'Argentina',232 'Brasil',233 'Bolivia',234 'Alemanha',235 'Estados Unidos',236 'Bangladesh',237 'Congo'238 ]; 239 }240 geraEmitentesEntrega(quantidadeRegistros) { 241 let numeroRegistros = quantidadeRegistros;242 let _emitentesEntrega = [];243 for (let i = 1; i <= numeroRegistros; i++) {244 245 let randomCard = faker.helpers.createCard();246 let phone = faker.random.arrayElement(247 [248 '',249 randomCard.phone,250 ]251 );252 this.inscricaoEstadual[1] = faker.random.number({min: 11111111111, max: 99999999999999}); 253 this.caixaPostal[1] = faker.random.number({min: 11111111, max: 99999999}); 254 _emitentesEntrega.push({255 "id": i,256 "nomeAbreviado": randomCard.name,257 "codigo": i, 258 "nome": faker.name.firstName() + " " + faker.name.lastName(), 259 "matriz": randomCard.company.name,260 "grupo": faker.random.number({min: 0, max: 99}),261 "CGC": faker.random.number({min: 0, max: 642840580001978999}), 262 "natureza": faker.random.number({min: 1, max: 3}),263 "inscricaoEstadual": faker.random.arrayElement(this.inscricaoEstadual),264 "endereco": randomCard.address.streetA,265 "endereco2": randomCard.address.streetB,266 "bairro": randomCard.address.streetC,267 "cidade": randomCard.address.city,268 "estado": faker.random.arrayElement(this.estados),269 "cep": faker.random.arrayElement(270 [271 faker.random.number({min: 11111111, max: 99999999 }),272 randomCard.address.zipcode273 ]274 ),275 "caixaPostal": faker.random.arrayElement(this.caixaPostal),276 "pais": faker.random.arrayElement(this.countries),277 "transportadorPadrao": faker.random.number({min: 0, max: 99999}),278 "linhaProduto": faker.random.arrayElement(this.linhasProduto),279 "ramoAtividade": faker.random.arrayElement(this.ramosAtividade),280 "dataImplantacao": faker.date.between(this.dataInicio, this.dataFim),281 "emissaoPedido": faker.random.number({min: 1, max: 2}),282 "prog": faker.random.boolean(), // Não-Sim283 "mensagem": faker.random.number({min: 0, max: 1000}),284 "telefone": phone,285 "ramalTelefone": faker.random.arrayElement(['', faker.random.number({min: 0, max: 500})]),286 "telefaxRamal": faker.random.arrayElement(['', faker.random.number({min: 0, max: 500})]),287 "telefax": phone,288 "telex": phone,289 "telefax2": phone,290 "ramalTelefax2": faker.random.arrayElement(['', faker.random.number({min: 0, max: 500})]),291 "telefoneModem": phone,292 "ramalTelefone": faker.random.arrayElement(['', faker.random.number({min: 0, max: 500})]),293 "modem": phone,294 "email": randomCard.email,295 "homePage": randomCard.website,296 "parceiroEDI": faker.random.number({min: 0, max: 555}),297 "portador": faker.random.number({min: 0, max: 99999}),298 "modalidadeAP": faker.random.number({min: 1, max: 7}),299 "banco": faker.random.arrayElement(this.bancos),300 "agencia": faker.random.arrayElement(['', faker.random.number({min: 0, max: 999999})]),301 "contaCorrente": faker.random.arrayElement(['', faker.random.number({min: 0, max: 999999})]),302 "taxaFinanceira": faker.random.number({min: 0, max: 50}),303 "diasTaxaFinanceira": faker.random.number({min: 0, max: 200}),304 "tipoPagamento": faker.random.number({min: 0, max: 8}),305 "diasCompensacao": faker.random.number({min: 0, max: 200}),306 "tipoDespesaPadrao": faker.random.number({min: 0, max: 200}),307 "condicaoPagamento": faker.random.number({min: 0, max: 1000}),308 "vencimentoFeriado": faker.random.number({min: 1, max: 3}),309 "vencimentoDomingo": faker.random.number({min: 1, max: 3}),310 "vencimentoSabado": faker.random.number({min: 1, max: 3}),311 "observacao": faker.lorem.paragraphs(),312 "agenteRetencao": faker.random.boolean(),313 "rendimento": faker.random.boolean(),314 "tributacaoCOFINS": faker.random.number({min: 0, max: 2}),315 "tributacaoPIS": faker.random.number({min: 0, max: 2}),316 "PIS_COFINSporUnidade": faker.random.boolean(),317 "contribuinteSubstitutoIntermediario": faker.random.boolean(),318 "optanteCreditoPresumidoSubstituicaoTributaria": faker.random.boolean(),319 "InscrAuxST": faker.random.arrayElement(['', faker.lorem.word()]),320 "pagamentos": faker.random.number({min: 1, max: 2})321 });322 }323 return _emitentesEntrega;324 }325 ...
bubble.js
Source:bubble.js
...12$(window).on("load", function(){13 //Get the context of the Chart canvas element we want to select14 var ctx = $("#bubble-chart");15 var randomScalingFactor = function() {16 return (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100);17 };18 // Chart Options19 var chartOptions = {20 responsive: true,21 maintainAspectRatio: false,22 scales: {23 xAxes: [{24 display: true,25 gridLines: {26 color: "#f3f3f3",27 drawTicks: false,28 },29 scaleLabel: {30 display: true,31 labelString: 'Month'32 }33 }],34 yAxes: [{35 display: true,36 gridLines: {37 color: "#f3f3f3",38 drawTicks: false,39 },40 scaleLabel: {41 display: true,42 labelString: 'Value'43 }44 }]45 },46 title:{47 display:false,48 text:'Chart.js Bubble Chart'49 }50 };51 // Chart Data52 var chartData = {53 animation: {54 duration: 1000055 },56 datasets: [{57 label: "Medicine 1",58 backgroundColor: "#64FFDA",59 borderColor: "#64FFDA",60 data: [61 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},62 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},63 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},64 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},65 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},66 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},67 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},68 ]69 }, {70 label: "Medicine 2",71 backgroundColor: "#FF4081",72 borderColor: "#FF4081",73 data: [74 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},75 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},76 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},77 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},78 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},79 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},80 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},81 ]82 },{83 label: "Medicine 3",84 backgroundColor: "#7C4DFF",85 borderColor: "#7C4DFF",86 data: [87 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},88 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},89 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},90 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},91 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},92 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},93 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},94 ]95 }, {96 label: "Medicine 4",97 backgroundColor: "#FF6E40",98 borderColor: "#FF6E40",99 data: [100 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},101 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},102 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},103 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},104 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},105 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},106 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},107 ]108 },{109 label: "Medicine 5",110 backgroundColor: "#FFFF00",111 borderColor: "#FFFF00",112 data: [113 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},114 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},115 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},116 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},117 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},118 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},119 { x: randomScalingFactor(), y: randomScalingFactor(), r: Math.abs(randomScalingFactor()) / 5},120 ]121 }]122 };123 var config = {124 type: 'bubble',125 // Chart Options126 options : chartOptions,127 data : chartData128 };129 // Create the chart130 var bubbleChart = new Chart(ctx, config);131 // Randomize bubble chart data132 window.setInterval(function(){133 var zero = Math.random() < 0.2 ? true : false;134 colors = ["#64FFDA","#FF4081","#7C4DFF","#FF6E40","#FFEA00"];135 $.each(chartData.datasets, function(i, dataset) {136 dataset.backgroundColor = colors[i];137 dataset.borderColor = colors[i];138 dataset.data = dataset.data.map(function() {139 return {140 x: randomScalingFactor(),141 y: randomScalingFactor(),142 r: Math.abs(randomScalingFactor()) / 5,143 };144 });145 });146 bubbleChart.update();147 },2000);...
data.ts
Source:data.ts
1export const mapData: any = [2 {3 name: 'å京',4 value: Math.round(Math.random() * 1000),5 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],6 },7 {8 name: '天津',9 value: Math.round(Math.random() * 1000),10 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],11 },12 {13 name: 'ä¸æµ·',14 value: Math.round(Math.random() * 1000),15 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],16 },17 {18 name: 'éåº',19 value: Math.round(Math.random() * 1000),20 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],21 },22 {23 name: 'æ²³å',24 value: Math.round(Math.random() * 1000),25 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],26 },27 {28 name: 'æ²³å',29 value: Math.round(Math.random() * 1000),30 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],31 },32 {33 name: 'äºå',34 value: Math.round(Math.random() * 1000),35 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],36 },37 {38 name: 'è¾½å®',39 value: Math.round(Math.random() * 1000),40 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],41 },42 {43 name: 'é»é¾æ±',44 value: Math.round(Math.random() * 1000),45 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],46 },47 {48 name: 'æ¹å',49 value: Math.round(Math.random() * 1000),50 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],51 },52 {53 name: 'å®å¾½',54 value: Math.round(Math.random() * 1000),55 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],56 },57 {58 name: 'å±±ä¸',59 value: Math.round(Math.random() * 1000),60 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],61 },62 {63 name: 'æ°ç',64 value: Math.round(Math.random() * 1000),65 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],66 },67 {68 name: 'æ±è',69 value: Math.round(Math.random() * 1000),70 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],71 },72 {73 name: 'æµæ±',74 value: Math.round(Math.random() * 1000),75 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],76 },77 {78 name: 'æ±è¥¿',79 value: Math.round(Math.random() * 1000),80 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],81 },82 {83 name: 'æ¹å',84 value: Math.round(Math.random() * 1000),85 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],86 },87 {88 name: '广西',89 value: Math.round(Math.random() * 1000),90 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],91 },92 {93 name: 'çè',94 value: Math.round(Math.random() * 1000),95 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],96 },97 {98 name: '山西',99 value: Math.round(Math.random() * 1000),100 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],101 },102 {103 name: 'å
èå¤',104 value: Math.round(Math.random() * 1000),105 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],106 },107 {108 name: 'é西',109 value: Math.round(Math.random() * 1000),110 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],111 },112 {113 name: 'åæ',114 value: Math.round(Math.random() * 1000),115 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],116 },117 {118 name: 'ç¦å»º',119 value: Math.round(Math.random() * 1000),120 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],121 },122 {123 name: 'è´µå·',124 value: Math.round(Math.random() * 1000),125 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],126 },127 {128 name: '广ä¸',129 value: Math.round(Math.random() * 1000),130 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],131 },132 {133 name: 'éæµ·',134 value: Math.round(Math.random() * 1000),135 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],136 },137 {138 name: '西è',139 value: Math.round(Math.random() * 1000),140 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],141 },142 {143 name: 'åå·',144 value: Math.round(Math.random() * 1000),145 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],146 },147 {148 name: 'å®å¤',149 value: Math.round(Math.random() * 1000),150 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],151 },152 {153 name: 'æµ·å',154 value: Math.round(Math.random() * 1000),155 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],156 },157 {158 name: 'å°æ¹¾',159 value: Math.round(Math.random() * 1000),160 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],161 },162 {163 name: 'é¦æ¸¯',164 value: Math.round(Math.random() * 1000),165 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],166 },167 {168 name: 'æ¾³é¨',169 value: Math.round(Math.random() * 1000),170 tipData: [Math.round(Math.random() * 1000), Math.round(Math.random() * 1000)],171 },172];173export const getLineData = (() => {174 const category: any[] = [];175 let dottedBase = +new Date();176 const lineData: any[] = [];177 const barData: any[] = [];178 for (let i = 0; i < 20; i++) {179 const date = new Date((dottedBase += 1000 * 3600 * 24));180 category.push([date.getFullYear(), date.getMonth() + 1, date.getDate()].join('-'));181 const b = Math.random() * 200;182 const d = Math.random() * 200;183 barData.push(b);184 lineData.push(d + b);185 }186 return { barData, category, lineData };...
Season_W5.js
Source:Season_W5.js
...59 });60 }61 }62 oSym.addTask(3200, function k() {63 if (Math.random() * 3 < 2) {64 const ran = Math.floor(Math.random() * 5) + 1;65 oMiniGames.IceStorm(ran, ran, Math.floor(Math.random() * 3) + 1);66 } else {67 const def = [[1, 4], [3, 4], [4, 5], [1, 3], [3, 5], [2, 4], [1, 2], [2, 3]],68 Select = def[Math.floor(Math.random() * def.length)];69 oMiniGames.IceStorm(Select[0], Select[1], Math.floor(Math.random() * 2) + 1);70 }71 oSym.addTask(Math.random() * 3000 + 6000, k);72 });73 oMiniGames.ConveyorBelt(oS.PName, 325, 1, [oSporeShroom, oSporeShroom, oSporeShroom, oCherryBomb, oCherryBomb, "random", oDoomShroom, oJalapeno, "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", oCherryBomb, "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", oSporeShroom, oSporeShroom, oSporeShroom, "random", "random", "random", oRadish, "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", oDoomShroom, "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", oDoomShroom, oDoomShroom, "random", "random", oRadish, oRadish, oRadish, "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", oDoomShroom, "random", oDoomShroom, "random", "random", "random", "random", "random", "random", "random", "random", "random", "random", oCherryBomb, "random", "random", "random", "random", "random", "random", oJalapeno]);74 }75}, {76 AZ: [[oImp, 1, 1]],77 FlagNum: 1,78 FlagToMonitor: {},79 FlagToSumNum: {80 a1: [1],81 a2: [0]82 },83 FlagToEnd: function () {84 NewImg("imgSF", "images/interface/Clearance_reward.png", "left:260px;top:233px", EDAll, {85 onclick: function () {...
randomizer.py
Source:randomizer.py
1import random2binaer = ["1", "0"]3looper = True4datei = open("binary.txt", "a")5while looper == True:6 zahl = random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer) + random.choice(binaer)7 print(zahl)
...
pseudorandom.js
Source:pseudorandom.js
1goog.provide('goog.testing.PseudoRandom'); 2goog.require('goog.Disposable'); 3goog.testing.PseudoRandom = function(opt_seed, opt_install) { 4 goog.Disposable.call(this); 5 this.seed_ = opt_seed || goog.testing.PseudoRandom.seedUniquifier_ ++ + goog.now(); 6 if(opt_install) { 7 this.install(); 8 } 9}; 10goog.inherits(goog.testing.PseudoRandom, goog.Disposable); 11goog.testing.PseudoRandom.seedUniquifier_ = 0; 12goog.testing.PseudoRandom.A = 48271; 13goog.testing.PseudoRandom.M = 2147483647; 14goog.testing.PseudoRandom.Q = 44488; 15goog.testing.PseudoRandom.R = 3399; 16goog.testing.PseudoRandom.ONE_OVER_M = 1.0 / goog.testing.PseudoRandom.M; 17goog.testing.PseudoRandom.prototype.installed_; 18goog.testing.PseudoRandom.prototype.mathRandom_; 19goog.testing.PseudoRandom.prototype.install = function() { 20 if(! this.installed_) { 21 this.mathRandom_ = Math.random; 22 Math.random = goog.bind(this.random, this); 23 this.installed_ = true; 24 } 25}; 26goog.testing.PseudoRandom.prototype.disposeInternal = function() { 27 goog.testing.PseudoRandom.superClass_.disposeInternal.call(this); 28 this.uninstall(); 29}; 30goog.testing.PseudoRandom.prototype.uninstall = function() { 31 if(this.installed_) { 32 Math.random = this.mathRandom_; 33 this.installed_ = false; 34 } 35}; 36goog.testing.PseudoRandom.prototype.random = function() { 37 var hi = this.seed_ / goog.testing.PseudoRandom.Q; 38 var lo = this.seed_ % goog.testing.PseudoRandom.Q; 39 var test = goog.testing.PseudoRandom.A * lo - goog.testing.PseudoRandom.R * hi; 40 if(test > 0) { 41 this.seed_ = test; 42 } else { 43 this.seed_ = test + goog.testing.PseudoRandom.M; 44 } 45 return this.seed_ * goog.testing.PseudoRandom.ONE_OVER_M; ...
Using AI Code Generation
1var wptools = require('wptools');2var random = wptools.random();3console.log(random);4var wptools = require('wptools');5var random = wptools.random();6random.then(function(data) {7 console.log(data);8});9var wptools = require('wptools');10var random = wptools.random();11random.then(function(data) {12 console.log(data);13}).catch(function(err) {14 console.log(err);15});16var wptools = require('wptools');17var random = wptools.random({count: 5});18random.then(function(data) {19 console.log(data);20}).catch(function(err) {21 console.log(err);22});23var wptools = require('wptools');24var random = wptools.random({count: 5, namespace: 0});25random.then(function(data) {26 console.log(data);27}).catch(function(err) {28 console.log(err);29});30var wptools = require('wptools');31var random = wptools.random({count: 5, namespace: '0'});32random.then(function(data) {33 console.log(data);34}).catch(function(err) {35 console.log(err);36});37var wptools = require('wptools');38var random = wptools.random({count: 5, namespace: 'Main'});39random.then(function(data) {40 console.log(data);41}).catch(function(err) {42 console.log(err);43});44var wptools = require('wptools');45var random = wptools.random({count: 5, namespace: 'Category'});46random.then(function(data) {47 console.log(data);48}).catch(function(err) {49 console.log(err);50});51var wptools = require('wptools
Using AI Code Generation
1var wptools = require('wptools');2var random = wptools.random();3random.then(function(result) {4 console.log(result);5});6var wptools = require('wptools');7var random = wptools.random({8});9random.then(function(result) {10 console.log(result);11});12var wptools = require('wptools');13var random = wptools.random({14});15random.then(function(result) {16 console.log(result);17});18var wptools = require('wptools');19var random = wptools.random({20});21random.then(function(result) {22 console.log(result);23});24var wptools = require('wptools');25var random = wptools.random({26});27random.then(function(result) {28 console.log(result);29});30var wptools = require('wptools');31var random = wptools.random({32});33random.then(function(result) {34 console.log(result);35});36var wptools = require('wptools');37var random = wptools.random({38});39random.then(function(result) {40 console.log(result);41});42var wptools = require('wptools');
Using AI Code Generation
1var wptools = require('wptools');2var random = wptools.random();3random.then(function(result) {4 console.log(result);5});6var wptools = require('wptools');7var random = wptools.random();8random.then(function(result) {9 console.log(result);10});11var wptools = require('wptools');12var random = wptools.random();13random.then(function(result) {14 console.log(result);15});16var wptools = require('wptools');17var random = wptools.random();18random.then(function(result) {19 console.log(result);20});21var wptools = require('wptools');22var random = wptools.random();23random.then(function(result) {24 console.log(result);25});26var wptools = require('wptools');27var random = wptools.random();28random.then(function(result) {29 console.log(result);30});31var wptools = require('wptools');32var random = wptools.random();33random.then(function(result) {34 console.log(result);35});36var wptools = require('wptools');37var random = wptools.random();38random.then(function(result) {39 console.log(result);40});41var wptools = require('wptools');42var random = wptools.random();43random.then(function(result) {44 console.log(result);45});46var wptools = require('wptools');47var random = wptools.random();48random.then(function(result) {49 console.log(result);50});51var wptools = require('wptools');52var random = wptools.random();53random.then(function(result) {54 console.log(result);55});56var wptools = require('wptools');57var random = wptools.random();58random.then(function(result) {59 console.log(result);60});61var wptools = require('wptools');62var random = wptools.random();63random.then(function(result
Using AI Code Generation
1var wptools = require('wptools');2var random = wptools.random();3random.then(function(page){4 console.log(page);5});6var wptools = require('wptools');7var random = wptools.random();8random.then(function(page){9 console.log(page);10});11var wptools = require('wptools');12var random = wptools.random();13random.then(function(page){14 console.log(page);15});16var wptools = require('wptools');17var random = wptools.random();18random.then(function(page){19 console.log(page);20});21var wptools = require('wptools');22var random = wptools.random();23random.then(function(page){24 console.log(page);25});26var wptools = require('wptools');27var random = wptools.random();28random.then(function(page){29 console.log(page);30});31var wptools = require('wptools');32var random = wptools.random();33random.then(function(page){34 console.log(page);35});36var wptools = require('wptools');37var random = wptools.random();38random.then(function(page){39 console.log(page);40});41var wptools = require('wptools');42var random = wptools.random();43random.then(function(page){44 console.log(page);45});46var wptools = require('wptools');47var random = wptools.random();48random.then(function(page){49 console.log(page);50});51var wptools = require('wptools');52var random = wptools.random();53random.then(function(page){
Using AI Code Generation
1const wptools = require('wptools')2const random = wptools.random()3random.then(function (page) {4 console.log(page)5})6const wiki = require('wikijs').default7wiki().random().then(function (page) {8 console.log(page)9})10const mediawiki = require('nodemw');11const client = new mediawiki({12});13client.getRandomPage(function (err, page) {14 if (err) {15 console.log(err);16 } else {17 console.log(page);18 }19});20const wptools = require('wptools')21const random = wptools.random()22random.then(function (page) {23 console.log(page)24})25const wiki = require('wikijs').default26wiki().random().then(function (page) {27 console.log(page)28})29const mediawiki = require('nodemw');30const client = new mediawiki({31});32client.getRandomPage(function (err, page) {33 if (err) {34 console.log(err);35 } else {36 console.log(page);37 }38});39const wptools = require('wptools')40const random = wptools.random()41random.then(function (page) {42 console.log(page)43})44const wiki = require('wikijs').default45wiki().random().then(function (page) {46 console.log(page)47})48const mediawiki = require('nodemw');49const client = new mediawiki({50});51client.getRandomPage(function (err, page) {52 if (err) {53 console.log(err);54 } else {
Using AI Code Generation
1var wptools = require('wptools');2var random = wptools.random();3random.then(function(page) {4 console.log(page.data);5});6var Wiki = require('wikijs').default;7Wiki().random(1).then(function(page) {8 console.log(page);9});10{ pageid: 14602,11 'Graham Greene OM CH (2 October 1904 – 3 April 1991) was an English novelist regarded by some as one of the greatest writers of the 20th century. His books, comprising primarily detective stories, thrillers, and literary novels, are noted for their irony, black humour, and insight into the lives of ordinary people. Greene was born in Berkhamsted, Hertfordshire, and educated at Berkhamsted School, where he first became interested in literature. He travelled to continental Europe in 1921 to improve his French and Italian, and he lived in Florence, Rome and Paris. He worked as a schoolmaster and as a sub-editor on the Times Literary Supplement before turning to journalism. He married Vivien Dayrell-Browning in 1926, and they had two sons and a daughter. In 1935, Greene published his first novel, Orient Express, which was followed by several successful novels, including The Power and the Glory (1939), Brighton Rock (1938), and The Heart of the Matter (1948). In 1936, Greene was recruited by the Secret Intelligence Service (MI6) to gather intelligence on the activities of the Italian and German embassies in London. He was twice invalided out of the army due to illness and, in 1940, he was seriously wounded while fighting in the Spanish Civil War. After the war, Greene worked as a foreign correspondent in several countries, including Greece, Turkey, France, the United States, and the Middle East. He was involved in the abortive coup against the government of Syria in 1949, and was arrested and briefly imprisoned. He was awarded the James Tait Black Memorial Prize for his 1948 novel The Heart of the Matter, and he received the inaugural James Tait Black Memorial Prize for his 1961 novel The End of the Affair. In 1972, Greene was appointed a Commander
Using AI Code Generation
1var wpt = require('webpagetest');2var test = wpt('www.webpagetest.org', 'A.2a0f1d3e2f9a3e3a0d3c3f3a3a3b3c3');3var location = 'Dulles:Chrome';4var runs = random.integer(1, 10);5test.runTest(url, {6}, function(err, data) {7if (err) return console.error(err);8console.log(data.data.testId);9});10var wpt = require('webpagetest');11var test = wpt('www.webpagetest.org', 'A.2a0f1d3e2f9a3e3a0d3c3f3a3a3b3c3');12var location = 'Dulles:Chrome';13var runs = random.integer(1, 10);14test.runTest(url, {15}, function(err, data) {16if (err) return console.error(err);17console.log(data.data.testId);18});19var wpt = require('webpagetest');20var test = wpt('www.webpagetest.org', 'A.2a0f1d3e2f9a3e3a0d3c3f3a3a3b3c3');21var location = 'Dulles:Chrome';22var runs = random.integer(1, 10);23test.runTest(url, {24}, function(err, data) {25if (err) return console.error(err);26console.log(data.data.testId);27});
Using AI Code Generation
1var wptools = require('wptools');2var wiki = wptools.page('Albert_Einstein');3wiki.random(function(err, doc) {4 console.log(doc);5});6{ pageid: 1138,7 extract: 'Albert Einstein (14 March 1879 – 18 April 1955) was a German-born theoretical physicist. He developed the theory of relativity, one of the two pillars of modern physics (alongside quantum mechanics). Einstein\'s work is also known for its influence on the philosophy of science. Einstein is best known in popular culture for his mass–energy equivalence formula E = mc2 (which has been dubbed "the world\'s most famous equation"). He received the 1921 Nobel Prize in Physics "for his services to theoretical physics, and especially for his discovery of the law of the photoelectric effect". He was nominated for the Nobel Prize in 1922, 1923, 1925, and 1930, but he declined the prize when it was awarded to him in 1921. In 1905, Einstein published four revolutionary papers on the special theory of relativity and the photoelectric effect. In 1911, he was offered the directorship of the Kaiser Wilhelm Institute for Physics, but he declined. He accepted a position at the Prussian Academy of Sciences in Berlin, in 1912. In 1914, he applied for, but was denied, a teaching position at the University of Zurich because he was not recognized as a full citizen of Switzerland. Einstein emigrated from Germany to the United States in 1933, and settled in Princeton, New Jersey, where he worked at the Institute for Advanced Study until his death in 1955. Einstein published more than 300 scientific papers along with over 150 non-scientific works. His intellectual achievements and originality have made the word "Einstein" synonymous with "genius".',
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!