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
int pinoSensorPIR = 7; | |
int bRate = 9600; | |
void setup() { | |
pinMode(pinoSensorPIR, INPUT); | |
Serial.begin(bRate); | |
} | |
void loop() { | |
Serial.println(!digitalRead(pinoSensorPIR)); |
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
library ieee; | |
use ieee.std_logic_1164.all; | |
entity carrimag is | |
generic | |
( | |
n : natural := 8 | |
); |
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 class Formatex { | |
public static void formatMatrix(int[][] inputArray2D) { | |
assert (inputArray2D.length == inputArray2D[0].length && inputArray2D != null) : "BadInputArrayException"; | |
StringBuilder latex = new StringBuilder( | |
"\\mathbf{G}_x = \\begin{bmatrix} "); | |
for (int i = 0; i < inputArray2D.length; i++) { | |
for (int j = 0; j < inputArray2D[i].length; j++) { | |
latex.append(inputArray2D[i][j]); | |
if (j != inputArray2D[i].length - 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
LIBRARY ieee; | |
USE ieee.std_logic_1164.all; | |
ENTITY bc IS | |
PORT (Reset, clk, inicio : IN STD_LOGIC; | |
Az, Bz : IN STD_LOGIC; | |
pronto : OUT STD_LOGIC; | |
ini, CA, dec, CP: OUT STD_LOGIC ); | |
END bc; |
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 concorrente; | |
public class Conta { | |
private int saldo = 0; | |
public synchronized boolean retira(int montante) { | |
assert (montante <= 0 || saldo < montante) : "montante: " + montante | |
+ "saldo: " + saldo; | |
saldo -= montante; | |
return true; |
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
program piscina; | |
var st: array[1..14] of char; | |
monitor cesto; | |
export pega, larga; | |
var ncesto: integer; | |
ccesto: condition; |
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
LIBRARY ieee; | |
USE ieee.std_logic_1164.all; | |
ENTITY contnb IS | |
PORT ( R : IN INTEGER RANGE 0 TO 7; | |
clk, limpa , carga : IN STD_LOGIC; | |
Q : BUFFER INTEGER RANGE 0 TO 7 ); | |
END contnb ; | |
ARCHITECTURE comportamento OF contnb IS |
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 class Main { | |
public static void main(String[] args) {} | |
public static void add(String fileName, String text) throws FileNotFoundException, IOException { | |
RandomAccessFile rafile = new RandomAccessFile(new File(fileName), "rw"); | |
rafile.seek(0); | |
rafile.write(text.getBytes()); | |
rafile.close(); | |
} |
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
#!/bin/sh | |
for fname in /home/tecnica/cemig/*/*/*; do | |
printf '0a\n<root>\n.\nw\n' | ed "$fname" | echo '</root>' >> "$fname" | |
done #[email protected] |
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 class Fila { | |
private final int[] dados; | |
private int inicio, fim, contador; | |
private final int max; | |
public boolean filaCheia() { | |
return contador == max; | |
} |