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
/* Solves | |
* https://www.hackerrank.com/challenges/array-and-simple-queries/problem | |
* But without caring about limited resources =) | |
* @author Wanderley Caloni <wanderley.caloni@gmail.com> | |
* @date 2024-09-05 | |
*/ | |
#include <cmath> | |
#include <cstdlib> | |
#include <cstring> | |
#include <iostream> |
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
/* | |
Multiple peers Wireguard calculation | |
Wireguard does not support overlapping allowed ips for multiple peers. To cover all possible ips excluding others for secondary peers some calculation is needed to mount the allowed ips list derived from 0.0.0.0. | |
*/ | |
using System.Net; | |
public class Program | |
{ | |
private static void CalculateWireguardAllowedIps(ref HashSet<IPNetwork2> list, IPNetwork2 ip, IPNetwork2 remove) |
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
//******TESTAR EM LINUX****** | |
//*******CONFERIR SE A IDENTAÇÃO ESTÁ HOMOGENEA OU ESPACOS OU TAB******** | |
//*****CRIAR CABEÇALHO****** | |
//TODO colocar exemplo de CSV, já que ele começa lendo um. | |
#include <iostream> | |
#include <fstream> | |
#include <iomanip> |
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 <conio.h> | |
#include <string.h> | |
#define MAX_BEBIDAS_NA_ESTEIRA 3 | |
#define MAX_ESTEIRAS 2 | |
typedef struct esteira_s |
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 <string.h> | |
int cmpstr(void const *a, void const *b) | |
{ | |
const char const *aa = *(const char const **)a; | |
const char const *bb = *(const char const **)b; | |
return strcmp(aa, bb); |
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 <string> | |
#include <iostream> | |
enum string_code | |
{ | |
sc_1, | |
sc_2, | |
sc_3, | |
sc_none | |
}; |
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 <string> | |
#include <iostream> | |
#define switch(a) auto switch_cmp = a; | |
#define case(a) if( switch_cmp == a ) | |
int main() | |
{ | |
std::string test = "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 <string.h> | |
int M[100][100]; | |
int J[100]; | |
int main() { | |
int T, N, n, t, i, j, k, ic, ii, jj, kk; | |
scanf("%d", &T); |
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
from PIL import Image | |
from PIL import ImageFont | |
from PIL import ImageDraw | |
from itertools import islice | |
TilePositions = [ | |
[32, 216], [153, 216], [274, 216], [395, 216], | |
[32, 339], [153, 339], [274, 339], [395, 339], | |
[32, 461], [153, 461], [274, 461], [395, 461], | |
[32, 584], [153, 584], [274, 584], [395, 584] |
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
/** Imprime uma tabela alinhando a primeira coluna à esquerda e a segunda | |
coluna à direita, respeitando o tamanho do maior campo da primeira coluna. | |
*/ | |
void printf_string_align_variable_size() | |
{ | |
struct GitBranches branches[2]; | |
char* cr; | |
size_t len1, len2, maxlen; | |
printf("master branch: "); |
NewerOlder