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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package javafxarduino; | |
import com.fazecast.jSerialComm.SerialPort; | |
import java.io.PrintWriter; | |
import java.net.URL; |
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
@FXML | |
private void ligarLed(ActionEvent event) { | |
PrintWriter output = new PrintWriter(porta.getOutputStream()); | |
if(led == 0){ | |
output.print("1"); | |
output.flush(); | |
led = 1; | |
}else{ |
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
@FXML | |
private void conectar(ActionEvent event) { | |
if (btnConectar.getText().equals("Conectar")) { | |
porta = SerialPort.getCommPort(cbPortas.getSelectionModel().getSelectedItem().toString()); | |
porta.setComPortTimeouts(SerialPort.TIMEOUT_SCANNER, 0, 0); | |
if (porta.openPort()) { | |
btnConectar.setText("Desconectar"); |
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
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package javafxarduino; | |
import com.fazecast.jSerialComm.SerialPort; | |
import java.net.URL; | |
import java.util.ResourceBundle; |
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
public void carregarPortas() { | |
SerialPort[] portNames = SerialPort.getCommPorts(); | |
for (SerialPort portName : portNames) { | |
cbPortas.getItems().add(portName.getSystemPortName()); | |
} | |
} |
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
public static File gravaArquivoDeURL(String stringUrl, String pathLocal) { | |
try { | |
//Encapsula a URL num objeto java.net.URL | |
URL url = new URL(stringUrl); | |
//Queremos o arquivo local com o mesmo nome descrito na URL | |
//Lembrando que o URL.getPath() ira retornar a estrutura | |
//completa de diretorios e voce deve tratar esta String | |
//caso nao deseje preservar esta estrutura no seu disco local. | |
String nomeArquivoLocal = url.getPath(); | |
//Cria streams de leitura (este metodo ja faz a conexao)... |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence version="2.0" | |
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> | |
<persistence-unit name="projetoPU" transaction-type="RESOURCE_LOCAL"> | |
<properties> | |
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/seuBanco"/> | |
<property name="javax.persistence.jdbc.user" value="root"/> |
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
#!/usr/bin/env python | |
import ctypes | |
FAKE = 0 #NÃO DETECTAR DEDO FALSO | |
#FAKE = 1; #DETECTAR DEDO FALSO | |
try: | |
sdk = ctypes.cdll.LoadLibrary('/usr/lib/libcis_sdk.so') | |
except: | |
print("Falha ao importar bibliotecas.") |
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 java.io.ByteArrayInputStream; | |
import java.io.InputStream; | |
import javax.print.Doc; | |
import javax.print.DocFlavor; | |
import javax.print.DocPrintJob; | |
import javax.print.PrintException; | |
import javax.print.PrintService; | |
import javax.print.PrintServiceLookup; | |
import javax.print.SimpleDoc; |
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
<?php | |
$post = filter_input_array(INPUT_POST, FILTER_DEFAULT); | |
if (isset($post)): | |
$post = array_map('strip_tags', $post); | |
include_once './libs/PHPMailerN/PHPMailerAutoload.php'; | |
$font_texto = "<font face='Arial' size='2'>"; | |
$ffont = "</font>"; |