Skip to content

Instantly share code, notes, and snippets.

View bchaber's full-sized avatar
😶
Don't shake the table

Bartek Chaber bchaber

😶
Don't shake the table
  • Warsaw University of Technology
  • Poland
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@bchaber
bchaber / symmetric-problem-fdm.jl
Last active May 31, 2023 08:26
Generatory problemów symetrycznych
function fdmproblem(n)
m = n
A = zeros(n*m, n*m)
dof = reshape(1:n*m, n, m)
for i=2:n, j=1:m
A[dof[i,j], dof[i-1,j]] -= 1.0
A[dof[i,j], dof[i,j]] += 1.0
end
for i=1:n, j=2:m
A[dof[i,j], dof[i,j-1]] -= 1.0
import os
import random
import string
ALPHABET = string.ascii_lowercase + string.digits
def encrypt(password, text):
message = "".join([c.lower() if c.isalnum() else "" for c in text])
plaintext = [ALPHABET.find(c.lower()) for c in message]
keystream = [ALPHABET.find(c.lower()) for c in password]
n = len(plaintext)
@bchaber
bchaber / main.c
Created November 19, 2024 11:04
Program do zarządzania studentami
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
typedef struct student {
int uid; // unique identifier
float gpa; // grade point average
char *firstname;
char *lastname;
} student_t;