What do you want to save?
Add Code snippet
New code examples
-
Java 2021-11-08 13:56:16
java non blocking notifier
import java.util.concurrent.CompletableFuture; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; public class GetTaskNotificationWithoutBlocking { public static void main(String... argv) throws Exception { Exampl... Add solution -
Python 2021-11-08 03:32:16
basic python hangman game
import random, time fruits = ['pear', 'mango', 'apple', 'banana', 'apricot', 'pineapple','cantaloupe', 'grapefruit','jackfruit','papaya'] superHeroes = ['hawkeye', 'robin', 'Galactus', 'thor', 'mystique', 'superman', 'deadpool', 'vision', 'sandman', 'aqua... Add solution -
Python 2021-11-06 03:21:12
random forest from scratch python github
import numpy as np from collections import Counter #implement decision tree def entropy(d): c = np.bincount(d) c = c[c != 0] prop = c/len(d) E = - prop*np.log2(prop) return np.sum(E) class Node: def __init__(self, beast_split_fea... Add solution -
Python 2021-11-05 02:51:18
16 digit number generate on python
# Python3 code to demonstrate # generating random strings # using random.choices() import string import random # initializing size of string N = 7 # using random.choices() # generating random strings res... Add solution -
Python 2021-11-04 10:31:09
assign each point to the cluster with the closest centroid python
def kmeans(X, k, maxiter, seed = None): """ specify the number of clusters k and the maximum iteration to run the algorithm """ n_row, n_col = X.shape # randomly choose k data points as initial centro... Add solution -
Python 2021-11-02 07:11:15
how to randomly choose from a list python
random.choice(name of list) Add solution -
Python 2021-11-01 13:40:08
python generate random string
import random import string def random_string_generator(str_size, allowed_chars): return ''.join(random.choice(allowed_chars) for x in range(str_size)) chars = string.ascii_letters + string.punctuation size = 12 print(chars) print('Random String of... Add solution
Best helpers
Ranking is empty