This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Copy and paste any shape using space and '|', add an '*' to indicate the end of your stream | |
example input: | |
|| || | |
|| || || | |
|| || || | |
||| |||* | |
STart each line with at least one space and make sure your shape is no more than 60 characters in width to maintain general ASCII range | |
""" | |
import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function debounce(func, wait, immediate=false) { | |
var timeout; | |
return function() { | |
var context = this, | |
args = arguments; | |
var callNow = immediate && !timeout; | |
clearTimeout(timeout); | |
timeout = setTimeout(function() { | |
timeout = null; | |
if (!immediate) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import sqrt | |
from random import random | |
lim = 15 # int(input("Number of simulation: ")) | |
radius = 1.0 # float(input("Enter the radius: ")); | |
partition = 4 #{'full': 1, 'half': 2, 'quadrant': 4}[input("Enter the partition (full, half or quadrant): ")] | |
R1 = [round(random() * radius, 2) for i in range(0, lim)] | |
R2 = [round(random() * radius, 2) for i in range(0, lim)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
from math import ceil | |
N=100 | |
lim=100 #int(input("enter total random number :")) | |
intrv = 10 | |
random_number = [randint(1, lim) for i in range(0, N)] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
a_mean = 10.0 | |
a_sd = 1.5 | |
s_mean = 9.5 | |
s_sd = 1.0 | |
lim = 15 | |
NR1 = [0] * lim | |
NR2 = [0] * lim | |
IAT = [0] * lim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const S = 30, reach = 30, timeout = 10; | |
let xb = [100, 110, 120, 130, 140, 149, 158, 168, 179, 188, 198, 209, 220], | |
yb = [0, 3, 6, 10, 15, 20, 26, 32, 37, 34, 30, 27, 23], | |
yf = [60], | |
xf = [0], | |
dist = [], | |
sinA = [], | |
cosA =[], | |
flag = false; | |
function run(time, intv = 1) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import randint | |
board = [ | |
[0, 0, 0], | |
[0, 0, 0], | |
[0, 0, 0], | |
] | |
def eq(arr): | |
s = set(arr) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testData = "Type Long NotLong Sweet NotSweet Yellow NotYellow Total\nBanana 400 100 350 150 450 50 500\nOrange 0 300 150 150 300 0 300\nOther 100 100 150 50 50 150 200\nTotal 500 500 650 350 800 200 1000" | |
file = open("data.txt", "w+") | |
file.write(testData) | |
file.close() | |
file = open("data.txt", "r") | |
lines = file.readlines() | |
file.close() | |
types = ['long', 'notlong', 'sweet', 'notsweet', 'yellow', 'notyellow', 'total'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from heapq import heappush, heappop | |
class PriorityQueue: | |
def __init__(self, iterable=[]): | |
self.heap = [] | |
for value in iterable: | |
heappush(self.heap, (0, value)) | |
def add(self, value, priority=0): | |
heappush(self.heap, (priority, value)) | |
def pop(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main(deem) { | |
"use strict"; | |
var unicodeRegex = | |
/([\uD800-\uDBFF][\uDC00-\uDFFF](?:[\u200D\uFE0F][\uD800-\uDBFF][\uDC00-\uDFFF]){2,}|\uD83D\uDC69(?:\u200D(?:(?:\uD83D\uDC69\u200D)?\uD83D\uDC67|(?:\uD83D\uDC69\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]\uFE0F|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC6F\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3C-\u |