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
name: Sum - Silva97 | |
source code: |- | |
input: '0010+0011' | |
blank: ' ' | |
start state: look | |
table: | |
left4: | |
0: {L: left3} | |
1: {L: left3} | |
'+': {L: left3} |
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
#include <stdio.h> | |
// Example of code in C to get substrings | |
char *substr(char *dest, char *src, int start, int end) | |
{ | |
char *start_address = dest; | |
for (src = src + start; *src && end > 0; dest++, src++, end--) { | |
*dest = *src; | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include "metric.h" // https://github.com/Silva97/metric | |
int smaller(int a, int b) | |
{ | |
if (a < b) { | |
return a; | |
} |
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
; Implementação do algoritmo de checksum RFC 1071 em Assembly x86-64. | |
; Exercício proposto pelo Frederico Pissarra. | |
bits 64 | |
default rel | |
section .text | |
; unsigned short cksum( void *ptr, size_t size ); | |
; Entrada: RDI = ptr |
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
#include <stdio.h> | |
#include <unistd.h> | |
enum { | |
READ = 0, | |
WRITE, | |
}; | |
int main(void) | |
{ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Observer</title> | |
<script src="./main.js"></script> | |
<style> | |
.list { | |
display: flex; | |
flex-direction: column; |
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
// Exemplo de impressão de caracteres Unicode em C. | |
#include <stdio.h> | |
#include <locale.h> | |
#include <wchar.h> | |
int main(void) | |
{ | |
wchar_t str[] = L"Oi ✌ cara! €€€"; | |
setlocale(LC_CTYPE, "pt_BR.utf8"); |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int cmpfloat(const void *n1, const void *n2) | |
{ | |
return *( (const float *) n1 ) > *( (const float *) n2 ); | |
} | |
#define SIZE 3 |
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
#include <stdio.h> | |
#include <stdlib.h> | |
void triangle(int, int); | |
int main(int argc, char **argv) | |
{ | |
triangle(atoi(argv[1]), 0); // 17 | |
return 0; | |
} |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#define ASIZE 4 | |
int main(void) | |
{ | |
// char *a[ASIZE]; | |
char **a = malloc(sizeof (char *) * ASIZE); | |
for (int i = 0; i < ASIZE; i++) |