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
/* | |
* @project: jGravity | |
* @version: 0.8 - 29/04/2012 | |
* @author: Craig Thomas - www.tinybigideas.com | |
* @project: http://tinybigideas.com/plugins/jquery-gravity/ | |
* @license: jGravity is licensed under a Open Source Initiative OSI MIT License: http://opensource.org/licenses/mit-license.php | |
* @changlog: http://tinybigideas.com/plugins/jquery-gravity/ | |
usage example: |
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 requests | |
from bs4 import BeautifulSoup | |
import openpyxl | |
import xml.etree.ElementTree as ET | |
from concurrent.futures import ThreadPoolExecutor, as_completed | |
import re | |
import random | |
import time | |
proxies = [ |
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 | |
import matplotlib.pyplot as plt | |
import networkx as nx | |
from matplotlib.animation import FuncAnimation | |
# Definizione degli stati e delle transizioni della catena di Markov | |
states = ["salve", "ciao", "buongiorno", "buonasera", "hey"] | |
transitions = { | |
"salve": {"ciao": 0.3, "buongiorno": 0.3, "buonasera": 0.2, "hey": 0.2}, | |
"ciao": {"salve": 0.2, "buongiorno": 0.3, "buonasera": 0.2, "hey": 0.3}, |
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
# https://trovalost.it/sitemap_index.xml | |
import requests | |
from bs4 import BeautifulSoup | |
import pandas as pd | |
# Funzione per estrarre title e meta description da una pagina | |
def extract_title_meta(url): | |
try: | |
response = requests.get(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
import tkinter as tk | |
# Funzione per disegnare un poligono | |
def draw_polygon(canvas, vertices): | |
canvas.create_polygon(vertices, outline='black', fill='') | |
# Funzione Bubble Sort per ordinare le intersezioni lungo l'asse x | |
def bubble_sort(canvas, intersections): | |
n = len(intersections) | |
for i in range(n): |
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>Hello Three.js</title> | |
<style> | |
body { margin: 0; } | |
canvas { display: block; } | |
</style> | |
</head> |
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
<?PHP | |
/** | |
* | |
* Plugin Name: AZ Listing 2 | |
* Description: The cat is under the ground | |
* Author: Salvatore Capolupo | |
* Version: 1.0 | |
* Author URI: http://www.trovalost.it | |
*/ |
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
Ecco la condizione corretta per verificare se una matrice è una matrice simmetrica: | |
INIZIO | |
Come prima cosa poniamo di avere la matrice già piena: | |
m ={{1,2,3},{1,2,3},{1,2,3}} ad es. | |
se m[][] è la matrice, per ogni i e per ogni j devo avere: | |
m[i][j] == m[j][i] | |
//se per qualche condizione è false, è false anche la condizione cercata | |
//nota gli elementi sulla diagonale principale m[i][i] non contano |
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 turtle | |
import random | |
# Funzione per un passo casuale in due dimensioni | |
def random_step(): | |
return random.choice([(0, 1), (0, -1), (1, 0), (-1, 0)]) | |
# Funzione per eseguire la random walk in due dimensioni | |
def random_walk_2d(steps): | |
positions = [(0, 0)] # Inizializza la posizione iniziale |
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 turtle | |
import random | |
# Funzione per un passo casuale a destra o sinistra | |
def random_step(): | |
return random.choice([-1, 1]) | |
# Funzione per eseguire il random walk | |
def random_walk(steps): | |
positions = [0] # Inizializza la posizione iniziale |
NewerOlder