This file contains 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
time | valueA | valueB | valueC | |
---|---|---|---|---|
1 | 2 | 5 | 13 | |
2 | 3 | 4 | 14 | |
3 | 1 | 4 | 16 | |
4 | 7 | 4 | 12 | |
5 | 8 | 8 | 7 | |
6 | 8 | 13 | 9 | |
7 | 5 | 15 | 3 | |
8 | 4 | 17 | 2 | |
9 | 9 | 18 | 1 |
This file contains 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
#include <iostream> | |
using namespace std; | |
class Queue { // Class definition | |
private: //private members can only be accessed in the class | |
int queue_size; | |
protected: // protected members can ba accessed in derived classes | |
int* buffer; // pointer to first element of array | |
int front; // used for removing an element of array | |
int rear; // user for adding an element into queue |
This file contains 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
/* | |
Search HN upvoted from your browser and Export to CSV or HTML. | |
1. Navigate your browser to https://news.ycombinator.com/user?id=YOUR_USER_ID | |
2. Copy code to the browser console and run. | |
4. Look for the popup window in the upper-left corner of your browser. | |
*/ | |
(function () { | |
const popup = createPopup('HN upvoted'); | |
const base = 'news.ycombinator.com'; |
This file contains 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 as rd | |
for _ in range(10000): seen, n_draws = set(), 0 | |
while len(seen)<52: | |
seen.add(rd.randint(1,52)) | |
n_draws +=1 | |
result.append(n_draws) | |
print (sum(result) / len(result)) |
This file contains 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 asyncio | |
async def FizzBuzz(i: int): | |
await asyncio.sleep(i) | |
print("Fizz"*(i%3==0)+"Buzz"*(i%5==0) or i) | |
async def SleepFizzBuzz(l,loop): | |
tasks = [loop.create_task(FizzBuzz(i)) for i in range(1,l+1)] | |
for t in tasks: | |
await t |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# coding=utf-8 | |
import urllib3 as u | |
from bs4 import BeautifulSoup | |
from tabulate import tabulate | |
import pandas as pd | |
digikey_id_list = ['product-details', 'prod-att-table'] # Digi-Key tables | |
def get_soup(url): |
This file contains 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
<!DOCTYPE html><html><body> | |
<style> audio { filter: | |
sepia(100%) | |
saturate(220%) | |
grayscale(0) | |
contrast(60%) | |
hue-rotate(50deg) | |
invert(100%) | |
drop-shadow(0px 0px 0px #ff0000); | |
</style> |
This file contains 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 sympy import binomial as b | |
def getA2B(X,Y,x,y): | |
U,D,s = X==x,Y==y,x+y | |
u = sum([b(s,i) for i in range(0,y)]) | |
d = sum([b(s,i) for i in range(y+1,s+1)]) | |
r = u*U+b(s,y)+D*d | |
return r/2**s | |
print('B(3,4) C(3,3) => ',getA2B(3,4,3,3)) | |
# Problem represnetation : | |
# Enter destination coordinates B(X,Y) and intercept point C(x,y) |
NewerOlder