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
/* data una matrice salvata in un file con il formato | |
R C | |
A00 A01 .. .. AC | |
.. | |
.. | |
AR0 .. .... .. ARC | |
3 2 |
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 threading | |
import time | |
import random | |
nome_file_log = "esempio_log_competizione.txt" | |
mutex = threading.Lock() | |
def scrivi_log(nome_processo): | |
with mutex: |
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
/* | |
* ESERCIZIO: TODOLIST | |
* | |
* creare un programma che consenta di gestire | |
* un elenco di cose da fare. ogni todo è | |
* formato da (titolo, descrizione, done) | |
* dove done indica se è già stato | |
* realizzato. | |
* | |
* il programma deve consentire di |
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
#include <fstream> | |
#include <iostream> | |
#include <string> | |
int main() { | |
std::ifstream in_file{"dati.txt"}; | |
std::string line,search_string; | |
std::cout << "Inserisci stringa da cercare> "; |
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 threading | |
import time | |
contatore = 0 | |
occupata = False | |
lock = threading.Lock() | |
def incrementa_contatore(): | |
global contatore,occupata,lock | |
for _ in range(100000): |
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
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <sstream> | |
struct Persona { | |
std::string nome; | |
std::string cognome; | |
int matricola; | |
}; |
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
// aggiunta della rappresentazione con asterischi e della gestione di distribuzioni diverse, utilizzando <random> | |
// INTERMOMETRO | |
// | |
// date N misurazioni interere di un intermometro | |
// rappresentare con una adeguata struttura dati tali misurazioni | |
// - ricavare temperatura minima, massima e media del dataset delle misurazioni | |
// - ricavare un istogramma delle stesse sia in forma testuale che grafica | |
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
#include <iostream> | |
#include <vector> | |
// registrazione = nome, cognome, punteggio | |
struct registrazione { | |
std::string nome; | |
std::string cognome; | |
int punteggio; | |
}; |
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
void setup() { | |
// put your setup code here, to run once: | |
Serial.begin(9600); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
auto x = random(1,100); | |
Serial.println(x); | |
delay(1000); |
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
// scrivere una funzione che dati due vettori, crei un terzo vettore | |
// i cui elementi sono gli elementi comuni dei vettori di partenza senza | |
// ripetizioni | |
#include <algorithm> | |
#include <iostream> | |
#include <vector> |
NewerOlder