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
def radice_ennesima_newton(N, n, x0_initial, tolleranza=1e-7): | |
""" | |
Calcola la radice n-esima di un numero N usando il metodo di Newton, | |
fermandosi quando la convergenza raggiunge la tolleranza specificata. | |
Args: | |
N (float): Il numero di cui calcolare la radice. | |
n (int): L'indice della radice (es. 2 per radice quadrata, 3 per cubica). | |
x0_initial (float): La stima iniziale x_0 per l'algoritmo di Newton. | |
tolleranza (float): La massima differenza accettabile tra due iterazioni successive. |
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
// Coded by Pietro Squilla | |
// Semplifica l'uso del cifrario di Hill con carta e penna ricercando matrici con det = +-1; | |
// osservazione: se la matrice ha determinante 1 o -1 la sua inversa conterrà numeri interi | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <math.h> | |
// grandezza alfabeto -> modulo base = MASSIMO + 1 | |
#define MINIMO 0 |
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
# Coded by Scratchy | |
# inserisci i coefficienti di una matrice chiave e gli elementi di n vettori da moltiplicare modularmente | |
import numpy as np | |
n = int(input("Inserisci la dimensione della matrice quadrata: ")) | |
modulo = int(input("Inserisci il modulo di base (elementi dell'alfabeto): ")) # consigliato: 26 + 3 | |
matrice = np.zeros((n,n)) | |
# input dei coefficienti della matrice | |
for i in range(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
// Coded by ScratchyCode | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
long long int contatore = 0; | |
void stampa(int segnale); |
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
/* | |
Coded by ScratchyCode; | |
Vigenere = Vernam se: | |
- chiave lunga quanto il testo in chiaro | |
- chiave con lettere casuali | |
- chiave one time pad | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> |
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
#!/bin/bash | |
# cattura CTRL+Z | |
trap '' SIGTSTP | |
# display messaggio e metti in pausa | |
pause(){ | |
local m="$@" | |
echo "$m" | |
read -p "Premi [INVIO] per continuare..." key |
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
// Coded by ScratchyCode | |
// Cifrario a permutazioni pseudocasuali in stile CR4 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
#include <stdbool.h> | |
#define LIM 10000 |
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
// Coded by Scratchy | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <complex.h> | |
#include <tgmath.h> | |
//#define EPSILON 0.0001 | |
void polari(long double a, long double b, long double *rho, long double *theta); |
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 scapy.all import * | |
import random | |
import threading | |
import signal | |
import sys | |
def address_spoofer(): | |
addr = [192,168,178,1] | |
dot = '.' | |
addr[0] = str(random.randrange(11,197)) |
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 | |
MIN = 0 | |
MAX = 1 | |
#lanci = int(input("Numero di lanci: ")) | |
lanci = 10000000 | |
if(lanci <= 0): | |
print("Uscita...") | |
quit() |
NewerOlder