Skip to content

Instantly share code, notes, and snippets.

View gist:c06def3accc207df94c8
server {
listen 443 ssl;
# certs sent to the client in SERVER HELLO are concatenated in ssl_certificate
ssl_certificate /path/to/signed_cert_plus_intermediates;
ssl_certificate_key /path/to/private_key;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
# Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits
View test.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
import Data.Monoid
import Data.Proxy
data Colour = Red | Green | Blue deriving (Show)
data Size = Large | Small deriving (Eq, Show)
View get-stack.sh
#!/usr/bin/env bash
yell() { echo "$0: $*" >&2; }
die() { RETCODE=$1; shift; yell "$*"; exit ${RETCODE}; }
try() { "$@" || die 111 "cannot $*"; }
goDarwin() {
GHCVER="$(ghc --version)"
View gist:d3d3b6c087ce607dc804
import random
target_diffusion = 0.1
population=[[0,8,4], [2,7,2]]
pop_diffusion=[abs(0.1*max(x)) for x in zip(*population)]
individual=population[0]
while True:
rand_diffusion=[random.gauss(0, v) for v in diffusion]
View .sh
#!/usr/bin/env bash
relpath() { # don't mind me, I'm just a mere tool
python2.7 -c 'import os.path, sys; print os.path.relpath(sys.argv[1],sys.argv[2])' "$1" "${2-$PWD}"
}
declare -a PKG_OK=()
PKG_FAIL=()
PKG_ALL=()
View runevo.sh
#!/bin/sh
#PBS -l walltime=030:00:00
#PBS -l nodes=1:ppn=12
#PBS -q plgrid
#PBS -l mem=1500mb
export EV_REPONAME="evogil.${PBS_JOBID}"
export EV_PYTHON="${HOME}/local_python/bin/python"
export EV_PROBLEMS="ZDT1,ZDT2,ZDT3,ZDT4,ZDT6,UF1,UF2,UF3,UF4,UF5,UF6,UF7,UF8,UF9,UF10,UF11,UF12"
View gist:c3e16065333ed1cb6fbe
2015-06-23 23:47:42582 50672 algorithms.HGS.HGS DEBUG Created HGS <algorithms.HGS.HGS.HGS object at 0x10ebab5c0>
2015-06-23 23:47:42582 50672 algorithms.HGS.HGS DEBUG Creating root node with 50 indivs
2015-06-23 23:47:42583 50672 algorithms.HGS.HGS DEBUG Creating Node 0
2015-06-23 23:47:42583 50672 algorithms.HGS.HGS DEBUG Node #0 creating driver with 50 indivs
2015-06-23 23:47:42583 50672 evotools.run_parallel DEBUG Dropping this dummy obj, returning partial instead: <class 'algorithms.HGS.HGS.HGS'>
2015-06-23 23:47:42583 50672 algorithms.HGS.HGS DEBUG Created HGS <algorithms.HGS.HGS.HGS object at 0x10ebab518>
2015-06-23 23:47:42583 50672 algorithms.HGS.HGS DEBUG Creating root node with 50 indivs
2015-06-23 23:47:42584 50672 algorithms.HGS.HGS DEBUG Creating Node 0
2015-06-23 23:47:42584 50672 algorithms.HGS.HGS DEBUG Node #0 creating driver with 50 indivs
2015-06-23 23:47:42584 50672 evotools.run_parallel DEBUG Beginning processing of <algorithms.HGS.HGS.HGS object at 0x10ebab518>, args: (('ZDT4', 'HGS+NSGA
View gist:312affd097d3571bdd50
[ PROBLEM ]..[ ALGO ]..[N ]..[Budgt]..[ METRICS OY ]..[ ✓ ]..[ RESULT, confidence interval ]..[ σ ]..[ OUTLIERS ]..[ RES w/o outliers ]..[ σ w/o outliers ]..[ (C INT)/METRICS ]..
kursawe :: IMGA+SPEA2 :: 3 :: 500 :: cost :: ✓ :: 510.000 ≤ 510.000 ≤ 510.000 :: 0.000 :: -- mild -- extr. :: 510.000 ( +0.000%) :: 0.000 ( inf%) :: 0.000% ::
kursawe :: IMGA+SPEA2 :: 3 :: 500 :: gd :: ✓ :: 0.014 ≤ 0.025 ≤ 0.042 :: 0.013 :: -- mild -- extr. :: 0.025 ( +0.000%) :: 0.013 ( 0.000%) :: 117.374% HIGH ::
kursawe :: IMGA+SPEA2 :: 3 :: 500 :: igd :: ✓ :: 0.004 ≤ 0.013 ≤ 0.018 :: 0.006 :: -- mild -- extr. :: 0.013 ( +0.000%) :: 0.006 ( 0.000%) :: 114.233% HIGH ::
kursawe :: IMGA+SPEA2 :: 3 :: 500 :: epsilon :: ✓
@kgadek
kgadek / logtest.py
Last active Aug 29, 2015
logtest.py
View logtest.py
from contextlib import contextmanager, closing
import logging
from logging.handlers import QueueHandler
import multiprocessing
from multiprocessing.pool import Pool
from multiprocessing.queues import Queue
@contextmanager
def background_process(x):
View gist:409a03720b0c5323ef05
2015-06-19 11:36:00922 pr:48518 evotools.run_parallel DEBUG msg:Starting the worker. args:(('kursawe', 'IMGA+OMOPSO'), [500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 8500, 9000, 9500], 0, '3')
2015-06-19 11:36:00923 pr:48518 evotools.run_parallel DEBUG msg:Renice the process PID:48518 by 3
2015-06-19 11:36:00923 pr:48518 evotools.run_parallel DEBUG msg:Getting random seed
2015-06-19 11:36:00924 pr:48518 evotools.run_parallel DEBUG msg:Starting preparation
2015-06-19 11:36:00924 pr:48518 evotools.run_parallel DEBUG msg:Preparing OMOPSO for kursawe
2015-06-19 11:36:00924 pr:48518 evotools.run_parallel DEBUG msg:driver class:∅
2015-06-19 11:36:00929 pr:48518 evotools.run_parallel DEBUG msg:Starting with config containing meta-parameters
2015-06-19 11:36:00930 pr:48518 evotools.run_parallel DEBUG msg:config: {'__metaconfig__populationsize': 100}
2015-06-19 11:36:00930 pr:48518 evotools.run_parallel DEBUG msg:Per-problem config: {'fitnesses': [<function fit_a at 0x1
You can’t perform that action at this time.