Skip to content

Instantly share code, notes, and snippets.

View mfilipelino's full-sized avatar
🏠
Working from home

Marcos Lino mfilipelino

🏠
Working from home
  • SSense
  • Montreal - Canada
View GitHub Profile
@mfilipelino
mfilipelino / prime.py
Last active November 25, 2022 14:26
is prime
def is_prime(number):
if number <= 0:
return False
if number == 1:
return True
elif number == 2:
return True
else:
for i in range(2, number):
if number % i == 0:
print('hello')
@mfilipelino
mfilipelino / unit_test_integragion.c
Last active May 20, 2016 02:22
test unit integration file
// Framework unit_test c
#include <stdio.h>
#include <string.h>
// variaveis de teste
int a, *b;
// framework start
@mfilipelino
mfilipelino / vector.c
Last active May 20, 2016 01:48
vector int
/*
TODO:
function:
[] vector_erase
error:
[] implements error
*/
#define SPEED 75
#define INPUT_BLACKCOLOR 1
#define INPUT_BLUECOLOR 2
#define INPUT_GREENCOLOR 3
#define INPUT_YELLOWCOLOR 4
#define INPUT_REDCOLOR 5
#define INPUT_WHITECOLOR 6
//************ ÚLTIMO CÓDIGO *****************
@mfilipelino
mfilipelino / bfs.py
Last active July 5, 2019 18:43
Bfs algorithm
import Queue
Grafo = { 0 : [1, 3],
1 : [0, 2],
2 : [1, 3],
3 : [0, 2]
}
def queue_insert(q, v):
#define THRESHOLD 40
struct ColorState {
int colorval;
unsigned int raw[];
unsigned int norm[];
int scaled[];
};
string debug_std_colors[] = {
@mfilipelino
mfilipelino / todascombinacoes.py
Last active November 10, 2015 13:05
Todas as combinações de um conjunto #backtrack #combinatory
def imprime(letras, vet, lst):
s = ''
for x in xrange(len(letras)):
if vet[x] == True:
s += letras[x]
lst.append(s)
def combinacoes(letras, vet, p, n, lst):
#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;
@mfilipelino
mfilipelino / ContainerThreadPool.java
Created August 19, 2015 00:12
#java #thread #concurrent #pool #threadpool #Executors #ExecutorService
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class ContainerThreadPool {
private static ContainerThreadPool contairnerThreadPoll;
public static ContainerThreadPool getInstance() {