Skip to content

Instantly share code, notes, and snippets.

View astarasikov's full-sized avatar
🐈
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈

Alexander Tarasikov astarasikov

🐈
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈
View GitHub Profile
#!/bin/bash
#get the sources via
#svn cat http://svn.tudos.org/repos/oc/tudos/trunk/repomgr | perl - init http://svn.tudos.org/repos/oc/tudos fiasco l4re
#install the required software
#apt-get install make gawk g++ binutils pkg-config subversion grub2iso
#use double quotes in case some spaces or other weird chars are present
FOC_ROOT="$PWD"
@astarasikov
astarasikov / gist:5446478
Created April 23, 2013 19:09
C++ Resource Pool Implementation
#include <cstdio>
#include <pthread.h>
#define cas __sync_bool_compare_and_swap
#define TEST_MUTEX 0
#if TEST_MUTEX
#define MUTEX_TEST(x) x
#else
@astarasikov
astarasikov / hamming.cpp
Created March 28, 2013 21:59
Hamming coding
/*
* Author: Alexander Tarasikov <[email protected]>
* Date: 2013-03-28
*
* Variant 5
* Hamming (15, 11) code
*
*/
#include <iostream>
#define RPC_PACK_RAW(buffer, idx, pvalue, size) do {\
if (idx + size >= RPC_PAYLOAD_MAX) {\
RPC_ERROR("data too large");\
goto fail; \
}\
memcpy(buffer + idx, pvalue, size);\
idx += size;\
} while (0)
#define RPC_PACK(buffer, idx, value) \