Skip to content

Instantly share code, notes, and snippets.

View caloni's full-sized avatar

Wanderley Caloni caloni

View GitHub Profile
/** 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: ");
#include <string>
class T {
public:
inline operator std::string() const {
return "";
}
explicit inline operator uint64_t() const
{
#include <string>
class T {
public:
inline operator std::string() const {
return "";
}
explicit inline operator uint64_t() const
{
#include <windows.h>
#include <stdio.h>
#define INITIAL_BUFFER (MAX_PATH * 5)
char *listAllDirectories(char *path) {
WIN32_FIND_DATA data;
size_t bufferSize = INITIAL_BUFFER;
char *directories = (char*)calloc(1, bufferSize);
char *buffer = directories;
def problema_1001():
A = int( input() )
B = int( input() )
print("X =", A + B)
problema_1001()
#include "picoro/picoro.h"
#include <stdio.h>
#include <gmodule.h>
void* print_number(void* arg)
{
int* number = (int*)arg;
int counter = *number;
while (counter--)
{
#include <stdio.h>
int main(int argc, char* argv[])
{
int ret = 0;
printf("Exemplo de Menu\n"
"===============\n");
char opt;
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
static const size_t MAX_BLOCKS = 1000;
static size_t next_free_block = 0;
void* blocks[MAX_BLOCKS] = {};
void* block_alloc(size_t bytes)
#! /bin/sh
# From configure.ac Revision: 1.583 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for OpenSSH Portable.
#
# Report bugs to <openssh-unix-dev@mindrot.org>.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
@caloni
caloni / range-based-for-loops
Created July 31, 2017 22:29
VS 2017 15.3 Preview 5.0 test
// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4128.html#an-iterables-end-may-have-a-different-type-than-its-begin
// sentinels
#include <algorithm>
#include <vector>
#include <iostream>
#include <iterator>
using namespace std;
// For determining whether an iterator refers to a null value: