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 selenium import webdriver | |
import urllib.request | |
import time | |
class Finder: | |
def __init__(self, url): | |
self.driver = webdriver.Chrome() # this could be editable but whatever | |
self.driver.get(url) | |
def find(self, id): |
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 inputs import get_gamepad | |
import pygame | |
import time | |
def scale(dimension, coordinate, gamepad_max): | |
scaled = coordinate * dimension // (gamepad_max * 2) + dimension // 2 | |
return scaled if scaled > 0 else 0 | |
def display_text(text, screen, pos, font, color): | |
screen.blit(font.render(text, True, color), pos) |
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
use std::{fmt, marker::PhantomData}; | |
#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd)] | |
pub enum Value { | |
Zero, | |
One, | |
BitNumber, | |
} | |
impl fmt::Display for Value { |
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 math | |
import pronouncing | |
def evaluate_partial_precedence(A, B, tau, mA, mB): | |
c = i = j = 0 | |
while i < mA and j < mB: | |
curr_A = A[i] | |
curr_B = B[j] |
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 images | |
def ex(file_dati, file_png, spaziatura): | |
dimensions = data(file_dati) | |
biggest = tuple(map(lambda line: (sum(map(lambda building: building[0], line)) + spaziatura * (len(line) + 1), max(map(lambda building: building[1], line))), dimensions)) | |
w = max(map(lambda t: t[0], biggest)) | |
h = spaziatura * (len(dimensions) + 1) + sum(map(lambda t: t[1], biggest)) | |
black_stripe = [(0, 0, 0)] * w | |
picture = list(map(lambda _: black_stripe.copy(), range(h))) | |
curr_y = spaziatura | |
center_x = w >> 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
def ex(colors, D, img_properties): | |
if img_properties == "pattern_diff_": | |
images = [] | |
pattern_diff(set(colors), D, [[]], images, (-1,), tuple(), 0, 0) | |
if D == 1: | |
return [] | |
return list(map(lambda image: tuple(map(tuple, image)), images)) | |
else: |
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
mkdir -p $1 | |
mv $1.sv $1 | |
cd $1 | |
echo "read -sv $1.sv | |
hierarchy -top $1 | |
proc; opt; techmap; opt | |
write_json $1.js" > $1.ys |
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 math import sqrt as Z;print("\n".join(map(lambda t:"".join(t[1])if t[0]!=4 else"".join(t[1][:24])+"".join(map(lambda x:chr(ord(x)-3),"ud|#wudfhg#dvfll/#e|#skdqwdvp#?6"))+"".join(t[1][-24:]),enumerate([[" .\'`^\",:;Il!i><~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZmwqpdbkhao*#MW&8%B@$"[int((0.299*B(I[1][0])+0.587*B(I[1][1])+0.114*B(I[1][2]))*sum([k[0]*(n if(n:=sum([x*y for x,y in zip(N,L)]))>0 else 0)/Z(sum([x*x for x in N])*sum([x*x for x in L]))for k in[(0.6,(2,1,0),0),(0.2,(1,4,4),1)]if(L:=k[1]if k[2]else(k[1][0]-X*T,k[1][1]-Y*T,k[1][2]-T))!=[]and(S:=X*T-I[0][0])!=[]and(R:=Y*T-I[0][1])!=[]and(Q:=T-I[0][2])!=[]and(E:=Z(S*S+R*R+Q*Q))!=[]and(N:=(S/E,R/E,Q/E))!=[]],0.2)/3.64)]if I else" "for W in range(80)if(H:=1<<32)and(T:=H)and not(I:=None)and(X:=W/80-0.5)!=[]and(Y:=0.5-J/30)!=[]and(j:=min([(M,t)if(a:=2*(X*X+Y*Y+1))!=[]and(b:=2*(-M[0][0]*X-M[0][1]*Y-M[0][2]))!=[]and(A:=b*b-2*a*(sum([x*x for x in M[0]])-M[2]*M[2]))>0 and(U:=(-b-Z(A))/a)!=[]and(V:=(Z(A)-b)/a)!=[]and(t:=min(H if U<0 else U,H if V<0 else V))<T else( |
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
.globl main | |
.data | |
DNA1: | |
.asciiz "GAGCCTACTAACGGGAT" | |
DNA2: | |
.asciiz "CATCGTAATGACGGCCT" | |
.text | |
main: |
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
.globl main | |
.data | |
N: .word 6 | |
M: .word 6 | |
line0: .word 1, 2, 3, 4, 5, 6 | |
line1: .word 1, 2, 3, 4, 5, 6 | |
line2: .word 1, 2, 3, 4, 5, 6 | |
line3: .word 6, 5, 4, 3, 2, 1 | |
line4: .word 6, 5, 4, 3, 2, 1 |
OlderNewer