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 | |
from PIL import Image, ImageDraw | |
images = [] | |
zoom = 0.5 | |
width = int(860 * zoom) | |
height = int(630 * zoom) | |
def draw_frame(draw): |
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 PIL import Image, ImageDraw | |
images = [] | |
a = [ | |
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], | |
[1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0 ,0, 0, 0, 0, 0, 0, 0, 0, 1], | |
[1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0 ,0, 0, 0, 0, 0, 0, 0, 0, 1], | |
[1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0 ,0, 0, 0, 0, 0, 0, 0, 0, 1], | |
[1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0 ,0, 0, 0, 1, 0, 1, 1, 1, 1], | |
[1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0 ,0, 0, 0, 1, 0, 0, 0, 0, 0], |
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
oracle = [ | |
{"context": "", "question": "hello", "answer": "Hi!", "new_context": ""}, | |
{"context": "", "question": "life", "answer": "Yes, we have a life insurance!", "new_context": "life"}, | |
{"context": "", "question": "car", "answer": "Yes, we have an auto insurance!", "new_context": "car"}, | |
{"context": "", "question": "auto", "answer": "Yes, we have an auto insurance!", "new_context": "car"}, | |
{"context": "", "question": "vehicle", "answer": "Yes, we have an auto insurance!", "new_context": "car"}, | |
{"context": "", "question": "accident", "answer": "Oh, we are sorry! Is anyone injured?", "new_context": "accident_injured?"}, | |
{"context": "accident_injured?", "question": "yes", "answer": "Call 112! This is serious!", "new_context": "accident"}, | |
{"context": "accident_injured?", "question": "no", "answer": "Please give us the address...", "new_context": "accident_address"}, |
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 PIL import Image, ImageDraw | |
import random | |
import math | |
images = [] | |
w, h = 500, 300 | |
class Particle: | |
_x = 0 | |
_y = 0 | |
x = 0 |
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 pygame | |
import random | |
colors = [ | |
(0, 0, 0), | |
(120, 37, 179), | |
(100, 179, 179), | |
(80, 34, 22), | |
(80, 134, 22), | |
(180, 34, 22), |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Alpha Substitution Cipher</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> | |
</head> | |
<body style="margin: auto;"> | |
<div style="padding: 2em; max-width: 800px; align-self: center"> | |
<form> |
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> | |
int main(int argc, const char * argv[]) { | |
int n = 800; | |
int a[n][n], b[n][n], mult[n][n], i, j, k; | |
for(i = 0; i < n; ++i) | |
for(j = 0; j < n; ++j) | |
a[i][j] = 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
n = 300 | |
a = np.ones((n,n)) | |
b = np.ones((n,n)) | |
c = np.zeros((n,n)) | |
start_time = time.time() | |
for i in range(n): | |
for j in range(n): | |
for k in range(n): | |
c[i][j] += a[i][k] * b[k][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
n = 1000 | |
a = np.ones((n,n)) | |
b = np.ones((n,n)) | |
start_time = time.time() | |
c = a.dot(b) | |
print(f"I did it in {time.time() - start_time} sec.") |
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 pygame | |
pygame.init() | |
screen = pygame.display.set_mode((640, 480)) | |
pygame.display.set_caption("Heli") | |
done = False | |
clock = pygame.time.Clock() | |
# LOAD Images Here! | |
# Initialize some variables | |
while not done: | |
# GAME UPDATE |
OlderNewer