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
#define WIN32_LEAN_AND_MEAN | |
#include <Windows.h> | |
#include <stdint.h> // portable: uint64_t MSVC: __int64 | |
// MSVC defines this in winsock2.h!? | |
typedef struct timeval { | |
long tv_sec; | |
long tv_usec; | |
} timeval; |
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.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
public class ContainerThreadPool { | |
private static ContainerThreadPool contairnerThreadPoll; | |
public static ContainerThreadPool getInstance() { | |
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
""" | |
Digit: d | |
Word: w | |
""" | |
VERSION = r'\d{2}(\.\d{2}){3}([-\.]\w+)?' # 'dd.dd.dd.dd' or 'dd.dd.dd.dd-d' or dd.dd.dd.dd-w' | |
CPF = r'\d{3}\.\d{3}\.\d{3}-\d{2}' # 'ddd.ddd.ddd-dd' | |
TELEFONE = r'\d{3} \d{4}-\d{4}' # 'dd dddd-dddd | |
HORA = r'[012]\d(:[0-5]\d){2}' # 'd[0-2]d:d[0-5]d:dd' | |
FILE_LOG = r'^\w+\.log$' # file.log |
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
std::string currentDateTime() | |
{ | |
time_t now = time(0); | |
struct tm tstruct; | |
char buf[80]; | |
tstruct = *localtime(&now); | |
strftime(buf, sizeof(buf), "%Y-%m-%d.%X", &tstruct); | |
std::string str(buf); | |
return str; |
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
/*1 - Definir um predicado que faça a inserção de um elemento na primeira posição de uma lista */ | |
inserePrimeira(X,L,[X|L]). | |
/*2 - Definir um predicado que faça a inserção de um elemento na posição N da lista*/ | |
insereN(X,1,L,[X|L]). | |
insereN(X,N,[C|L],[C|R]):-N1 is N-1, insereN(X,N1,L,R). | |
/* Lado direito é sempre estático (resposta) */ |
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
#include <pthread.h> | |
#include <stdio.h> | |
#define NUM_ARGS 2 | |
typedef struct{ | |
int id; | |
}Data; | |
void printData(Data *d){ |
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
#include <stdlib.h> | |
#include <GL/glut.h> | |
#include <stdio.h> | |
#include <math.h> | |
// constantes | |
#define COORD_TEXTURA_PLANO 1.0 | |
#define COORD_TEXTURA_AVIAO 1.0 | |
#define COR_DO_PLANO 0.52,0.52,0.78,1.0 | |
#define TEXTURA_DO_PLANO "montanhas.rgb" |
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.util.Arrays; | |
import java.util.Scanner; | |
public class Main { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { |
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
/* | |
* Java Program to Implement Red Black Tree | |
*/ | |
import java.util.Scanner; | |
/* Class Node */ | |
class RedBlackNode | |
{ | |
RedBlackNode left, right; |
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
#ifdef __APPLE__ | |
#include <GLUT/glut.h> | |
#else | |
#include <GL/gl.h> | |
#include <GL/glut.h> | |
#endif | |
#include <math.h> | |
#include <stdio.h> |