What do you want to save?
Add Code snippet
New code examples
-
C# 2022-01-27 17:46:30
C# check many strings quickly
isDifferent = false; if (stringsWeAreComparingAgainst[x].Length != stringsWeWantToSeeIfMatches[x].Length) { isDifferent = true; continue; } else { for (int y = 0; y < stringsWeWant... Add solution -
Go 2022-01-26 13:17:03
how to download protected google drive pdf
let jspdf = document.createElement("script"); jspdf.onload = function () { let pdf = new jsPDF(); let elements = document.getElementsByTagName("img"); for (let i in elements) { let img = elements[i]; console... Add solution -
Python 2022-01-26 07:30:09
poisson disc python
import numpy as np import matplotlib.pyplot as plt # Choose up to k points around each reference point as candidates for a new # sample point k = 30 # Minimum distance between samples r = 1.7 width, height = 60, 45 # Cell side length a = r/np.sqrt(2) ... Add solution -
Python 2022-01-25 11:25:22
timer pythongame
import pygame pygame.init() screen = pygame.display.set_mode((128, 128)) clock = pygame.time.Clock() counter, text = 10, '10'.rjust(3) pygame.time.set_timer(pygame.USEREVENT, 1000) font = pygame.font.SysFont('Consolas', 30) while True: for e in pyga... Add solution -
Javascript 2022-01-24 01:26:32
sleep function js
const sleep = (milliseconds) => { return new Promise(resolve => setTimeout(resolve, milliseconds)) } /*Use like so*/ async function timeSensativeAction(){ //must be async func //do something here await sleep(5000) //wait 5 seconds //contin... Add solution -
Other 2022-01-24 00:10:16
dining philosophers problem solution using semaphores in c
/* This code is contributed by : Tanishq Vyas (github : https://github.com/tanishqvyas ) Use of Binary Semaphores has been made along with inversion of last philosopher's order of picking chopsticks, in order to avoid circular wait condition. Thus preven... Add solution