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 | |
| # Definindo Arrays | |
| a = np.array([1., .5, 2.5]) | |
| a = np.array([1., .5, 2.5], dtype = float) | |
| m = np.array([[1,2,3], [4,5,6], [7,8,9],[7,8,9],[7,8,9],[7,8,9],[7,8,9]]) | |
| a.shape #dimensões do array |
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
| # pip install flask | |
| # pip instal flask-sqlalchemy | |
| # sudo apt-get install libpq-dev | |
| # sudo pip install psycopg2 | |
| # sudo pip install redshift-sqlalchemy | |
| # sudo pip install sqlparse | |
| # sudo pip install mysqlclient |
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 multiprocessing | |
| import time | |
| class Monitor(multiprocessing.Process): | |
| def __init__(self, ): | |
| multiprocessing.Process.__init__(self) | |
| self.exit = multiprocessing.Event() |
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<stdio.h> | |
| int main(){ | |
| int entrada, horas, minutos, segundos, resto; | |
| printf("entrada em segundos:"); | |
| scanf("%d", &entrada); | |
| horas = entrada / 3600; | |
| resto = entrada % 3600; | |
| minutos = resto / 60; | |
| segundos = resto % 60; |
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 <stdio.h> | |
| #include<stdlib.h> | |
| #include<time.h> | |
| int **CriarMatriz(int L, int C){ | |
| // Aloca as linhas da matriz | |
| int **m = calloc(L, sizeof(int *)); | |
| // Aloca as colunas da matriz | |
| int i, j; |
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 <stdio.h> | |
| #include<stdlib.h> | |
| #include<time.h> | |
| int main(void) { | |
| // Alocação Dinâmica e Inicialização de uma Matriz |
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 <stdio.h> | |
| #include<stdlib.h> | |
| #include<time.h> | |
| int main(void) { | |
| // Alocação Dinâmica e Inicialização de uma Matriz |
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 <stdio.h> | |
| #include<stdlib.h> | |
| #include<time.h> | |
| int *CriarVetor(int n){ | |
| int i; | |
| // Cria um vetor dinamicamente alocado | |
| int *v = malloc(n * sizeof(int)); | |
| // Inicializa o vetor |
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
| /** | |
| Exemplifica o uso de sizeof em C */ | |
| #include <stdio.h> | |
| #include<stdlib.h> | |
| int main(void) { | |
| // Uma variável declarada dinamicamente | |
| int *x = calloc(1, sizeof(int)); | |
| // Se ocorrer erro ao alocar |
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
| /** | |
| Exemplifica o uso de sizeof em C */ | |
| #include <stdio.h> | |
| #include<stdlib.h> | |
| int main(void) { | |
| // Uma variável declarada dinamicamente | |
| int *x = malloc(1 * sizeof(int)); | |
| // Se ocorrer erro ao alocar |
NewerOlder