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
| def RLE_zigzag_encoder(data, rows, columns): | |
| encoding = [] | |
| prev = data[0][0] | |
| count = 1 | |
| go_down = None | |
| change_direction = True | |
| next_position = [0, 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
| import heapq | |
| class GreedySearch(object): | |
| ''' | |
| This class implements the greedy search algorithm. | |
| ''' | |
| def __init__(self, problem): | |
| ''' | |
| Constructor |
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 numpy as np | |
| import matplotlib.pyplot as plt | |
| img = plt.imread("gabriel.jpg") | |
| gray = np.zeros(np.shape(img)) | |
| for i in range(img.shape[0]): | |
| for y in range(img.shape[1]): | |
| pixel = img[i, y, :] |
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
| // (URI) 1451 - Teclado Quebrado | |
| #include <iostream> | |
| #include <string.h> | |
| int main() | |
| { | |
| bool writeOnHome; | |
| std::string inputString; |
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
| /** Inserting value at first index of vector and push the others to the right | |
| * @vector - vector | |
| * @size - vector total size | |
| * @value - value to be added | |
| */ | |
| void insertAtFront(int vector[], int size, int value) | |
| { | |
| int aux_1, aux_2 = value; | |
| for(int i = 0; i < size; i++) |
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 <msp430g2553.h> | |
| #include <stdio.h> | |
| /* Constantes, variáveis e protótipos de funções */ | |
| #define BUTTON BIT3 | |
| #define SENSOR1 BIT4 | |
| #define SENSOR2 BIT5 | |
| #define S_MOTOR BIT7 |