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
error = lambda t: pass # hipotetico | |
getToken = lambda: pass # hipotetico | |
token = getToken() | |
def eat(t): | |
if token == t: | |
token = getToken() | |
else | |
error() |
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
/* printmsg.c: print a message on the console */ | |
/* printmsg.c: print a message on the console */ | |
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
char *message; | |
if (argc != 2) { | |
fprintf(stderr, "usage: %s <message>\n", | |
argv[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
// IP Camera supports motion detection, which can be configured to send | |
// emails upon alarm is fired | |
// This go programme serve as a minimal smtp server, listening login requests | |
// from IP Camera, and triggers zmtrigger.pl through unix socket. | |
package main | |
import ( | |
"github.com/op/go-logging" | |
"net" |
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
Instalar Nagios 3 no Debian 9 (Todos os comandos devem ser executados como root): | |
1. Adicionar o repositório contendo o nagios3: | |
echo "deb http://packages.le-vert.net/nagios3/debian stretch main" > /etc/apt/sources.list.d/packages_le_vert_net_nagios3.list | |
2. Baixar a chave GPG do repositório: | |
wget -O - https://packages.le-vert.net/packages.le-vert.net.gpg.key | apt-key add - |
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
public class Pessoa { | |
private String nome; | |
private Pessoa pai; | |
private Pessoa mae; | |
public Pessoa(String nome, Pessoa pai, Pessoa mae) { | |
this.nome = nome; | |
this.pai = pai; | |
this.mae = mae; | |
} |
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 numpy as np | |
def multiplicar_matrizes(A, B): | |
def somatorio(i, j): | |
expressao = 'r['+ str(int(i + 1)) + ', ' + str(int(j + 1)) + ']=\t' | |
r = 0 | |
for k in range(len(A[i])): | |
expressao += '(' + str(int(A[i][k])) + '*' + str(int(B[k][j])) + ')' | |
if k < len(A[i]) - 1: | |
expressao += ' +\t' |
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
const int PINO_TERMOMETRO = 0; // o termometro está ligado no A0 | |
int amostras = 0; | |
float temperatura = 0; | |
void setup() { | |
Serial.begin(9600); | |
Serial.println("tempo,temperatura"); | |
} | |
void enviar_mensagem_computador() { |
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 csv | |
import numpy as np | |
from scipy.optimize import curve_fit | |
from sys import argv | |
csvfile = open(argv[1], 'r') | |
linhas = csv.DictReader(csvfile) | |
Y, t = [], [] |
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
tempo | temperatura | |
---|---|---|
0 | 67.45 | |
1 | 67.94 | |
2 | 67.45 | |
3 | 66.96 | |
4 | 66.47 | |
5 | 66.47 | |
6 | 65.98 | |
7 | 65.49 | |
8 | 65.00 |
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
const int PINO_TERMOMETRO = 0; // o termometro LM35 está ligado no A0 | |
const int PINO_SECADOR = 2; // o secador de cabelos está ligado ao D2 | |
const float temperatura_referencia_superior = 73; | |
const float temperatura_referencia_inferior = 67; | |
float temperatura; | |
bool terminado; | |
void setup() { | |
// flag de execucao, para evitar que o secador seja religado após o período de funcionament |
OlderNewer