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
// Todos os feriados móveis do calendário brasileiro são calculados a partir da Páscoa. | |
/** | |
* Cálculo da data da Páscoa pelo algoritmo de Meeus. | |
*/ | |
function pascoa(ano) { | |
const a = ano % 19; | |
const b = ~~(ano / 100); // Inteiro da divisão | |
const c = ano % 100; | |
const d = ~~(b / 4); |
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 java.util.stream.IntStream; | |
public class CPF { | |
private final String root; | |
private final String checksum; | |
private final int regionCode; | |
private final Region region; | |
public CPF(String baseValue) { |
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
BEGIN TRANSACTION; -- Whenever possible use transactions when dealing with large amounts of data | |
INSERT INTO [database].[dbo].[table_name] ([field1], [field2], [field3]) | |
SELECT 'value for row 1 field 1', 'value for row 1 field 2', 'value for row 1 field 3' UNION ALL | |
SELECT 'value for row 2 field 1', 'value for row 2 field 2', 'value for row 2 field 3' UNION ALL | |
-- ...N-thousand other rows... | |
SELECT 'value for row n-1 field 1', 'value for row n-1 field 2', 'value for row n-1 field 3' UNION ALL | |
SELECT 'value for row n field 1', 'value for row n field 2', 'value for row n field 3'; -- No 'UNION ALL' statement on the last line | |
COMMIT TRANSACTION; |