Skip to content

Instantly share code, notes, and snippets.

View r2p2's full-sized avatar

Robert Peters r2p2

View GitHub Profile
[pid 9540] rt_sigprocmask(SIG_SETMASK, ~[TRAP RT_1], <unfinished ...>
[pid 9511] write(9, "T,\261\276\5\0\0\0\370U\1\0\374U\1\0\fV\1\0`B\1\0\\B\1\0\20(\261\276"..., 148 <unfinished ...>
[pid 9540] <... rt_sigprocmask resumed> NULL, 8) = 0
[pid 9511] <... write resumed> ) = 148
[pid 9540] read(8, <unfinished ...>
[pid 9511] rt_sigprocmask(SIG_SETMASK, NULL, <unfinished ...>
[pid 9540] <... read resumed> "T,\261\276\5\0\0\0\370U\1\0\374U\1\0\fV\1\0`B\1\0\\B\1\0\20(\261\276"..., 148) = 148
[pid 9511] <... rt_sigprocmask resumed> [RTMIN], 8) = 0
[pid 9540] poll([{fd=8, events=POLLIN}], 1, 2000 <unfinished ...>
[pid 9511] write(9, " 5\36@\0\0\0\0\0\0\0\0\270\350\4@TV\1\0\0\0\0\200\0\0\0\0x\362\35@"..., 148 <unfinished ...>
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script>
$(window).resize(function() {
$('.panel.full-height').each(function() {
$(this).height($(window).height() - $(this).offset().top - 20);
// g++ main.cpp -std=gnu++0x
#include <vector>
#include <memory> // shared_ptr
template <class T>
class Base
{
public:
Base(T value)
:m_value(value)
// g++ main2.cpp -std=gnu++0x
#include <vector>
#include <memory> // shared_ptr
template <class T>
class Base
{
public:
Base(T value)
:m_value(value)
#include <vector>
template <class T>
class Foo
{
public:
void bar()
{
typename std::vector<T>::const_iterator it;
}
#include <stdint.h>
#include <stdio.h>
#include <cstring>
#include <fstream>
#include <map>
#include <arpa/inet.h>
uint32_t* load_code(char *file, uint32_t &filesize)
{
uint32_t *p_code = NULL;
@r2p2
r2p2 / gist:630825
Created October 17, 2010 12:57
Nur ein paar Gedanken, wie eine WFE in Clojure umgesetzt werden könnte, runter programmiert. Wenn Agents tatsächlich so eingesetzt werden sollen, könnte ich mich wohl nur schwer mit ihnen anfreunden.
(defn start-process-by-agent [process-agent]
(send-off process-agent (fn [process-data] "running")))
(defn stop-process-by-agent [process-agent]
(send-off process-agent (fn [process-data] "stopped")))
(defn init [wfe-id]
(println "initiating wfe")
(println "TODO: load unfinished processes")
(agent (hash-map
@r2p2
r2p2 / WFE in Clojure
Created October 17, 2010 09:14
Mal wieder erste Gehversuche in Clojure.
(defn kill-process [process-channel]
(send process-channel (fn [a] "stop")))
(defn engine-loop [channel state process-list]
(loop [my-state state
my-process-list process-list]
(await channel)
(let [channel-value (deref channel)]
(do
(send channel (fn [a] "idle"))
@r2p2
r2p2 / gist:639192
Created October 21, 2010 19:55
Brainfuck
module Main where
import Char
type Tape = [Char]
type Machine = (Tape, Tape)
type Operation = Machine → IO (Machine)
type Operations = [Operation]
raise =
@r2p2
r2p2 / gist:1095090
Created July 20, 2011 14:43
Xer Signalklasse
#include <iostream>
#include <vector>
struct CallbackNoArg
{
};
class CallbackBase
{
public: