Skip to content

Instantly share code, notes, and snippets.

View AndreaCrotti's full-sized avatar

Andrea Crotti AndreaCrotti

View GitHub Profile
@AndreaCrotti
AndreaCrotti / gist:2482371
Last active October 20, 2016 22:34
haskell attempts
module Parser where
-- import Text.ParserCombinators.Parsec
type Var = String
type Value = String
type Assign = (Var, Value)
type Object = [Assign]
type Array = [Value]
@AndreaCrotti
AndreaCrotti / gist:1406149
Created November 29, 2011 19:46
Solution of euler problem 1 in C, without using mutable structures
/**
Euler problem number 1
*/
#include <stdlib.h>
#include <stdio.h>
#define MAX 1000
int to_sum[MAX];
# Doxyfile 1.7.3
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
# All text after a hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
Feb 23 19:09:33 misterbox postfix/smtp[15221]: warning: SASL authentication failure: No worthy mechs found
Feb 23 19:09:33 misterbox postfix/smtp[15221]: CA01B288: to=<mail@.com>, relay=server [ip]:25, delay=0.51, delays=0.26/0.02/0.23/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtpout.smtp[89.31.73.185]: no mechanism available)
alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
append_dot_mydomain = no
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_list = mobileemail.vodafone.it
home_mailbox = Maildir/
html_directory = no
#ifndef RINGBUFFER_H
#define RINGBUFFER_H
#include <deque>
template<typename T>
class RingBuffer
{
// TODO: see how to make it also iterable
private:
#ifndef RINGBUFFER_H
#define RINGBUFFER_H
// when I don't do any new do I still need a destructor?
// check how can I pass functions to execute inside it
// things should be as functional as possible
#define SUM(x, y) ((x + y) % max_size)
#define NEXT_POS(x) SUM(x, 1)
# A sample Makefile for building Google Test and using it in user
# tests. Please tweak it to suit your environment and project. You
# may want to move it to your project's root directory.
#
# SYNOPSIS:
#
# make [all] - makes everything.
# make TARGET - makes the given target.
# make clean - removes all files generated by make.
/***************************************************************************
* Copyright (C) 2007 by Jahn Bertsch *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
// -*- compile-command: "g++ stream.cpp -o streams" -*-
#include <iostream>
using namespace std;
class ComplexInt {
private:
int r, i;
public:
ComplexInt(int realPart = 0, int imagPart = 0);