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
| private static String getStringDuration(Temporal startDate, Temporal endDate){ | |
| Duration d = Duration.between(startDate, endDate); | |
| StringBuilder str = new StringBuilder(); | |
| long total = d.getSeconds(); | |
| long days = total / DAYS; | |
| if (days > 0) { | |
| str.append(days) | |
| .append("d "); | |
| total -= days * DAYS; |
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
| http://stackoverflow.com/questions/3365628/junit-tests-pass-in-eclipse-but-fail-in-maven-surefire | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-surefire-plugin</artifactId> | |
| <version>2.16</version> | |
| <configuration> | |
| <reuseForks>false</reuseForks> | |
| <forkCount>1</forkCount> | |
| </configuration> |
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
| mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Pcoverage-per-test && mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 |
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 | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| """ |
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
| function get(name){ | |
| if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search)) | |
| return decodeURIComponent(name[1]); | |
| } |
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
| package com.validator; | |
| /** | |
| * Faz a validação do TIA (Terminal Informativo do Aluno) do Mackenzie | |
| * @author gilson | |
| */ | |
| public class TIAValidator { | |
| private static final byte[] nums = {8, 7, 6, 5, 4, 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
| <?php | |
| parse_str(file_get_contents('php://input'), $vars); //Recebe as variaveis e guarda na variavel $vars | |
| var_dump($vars); //Verifica as variáveis recebidas | |
| ?> |
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
| Este documento tem por objetivo fornecer instruções para deixar o sistema completo após a instalação do mesmo. | |
| 1. Pacotes essenciais | |
| ethtool: útil para identificar se a interface de rede está recebendo sinal por um cabo de rede. Possui a mesma função do comando mii-tool. | |
| less: um filtro que permite a leitura de arquivos longos diretamente na tela. | |
| mc: o mc contém os programas Midnight Commander (mc) e mcedit. O mcedit é o editor de textos mais amigável para ambiente shell. | |
| tcpdump: utilizado para resolver problemas quando a máquina estiver operando em redes de computadores. | |
| Para instalar esses pacotes: |
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
| package matrizes; | |
| import java.io.BufferedReader; | |
| import java.io.FileReader; | |
| import java.io.IOException; | |
| /** | |
| * | |
| * @author bruce | |
| */ |
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
| CREATE TABLE livro ( | |
| id INT NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), | |
| nome VARCHAR(30) | |
| ); | |
| CREATE TABLE amigo ( | |
| id INT NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), | |
| nome VARCHAR(30), | |
| telefone VARCHAR(9) | |
| ); |