Skip to content

Instantly share code, notes, and snippets.

@egonelbre
egonelbre / handler_exclaim_main.go
Created February 1, 2014 20:15
Example handlers
package exclaim
import (
"server"
)
func Handle(message string) string {
return message + "!"
}
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
struct S1 {
int64_t TradeId;
int64_t ClientId;
int VenueCode;
int InstrumentCode;
int64_t Price;
AttendEvent = Context(
function(event, attendee) {
Event = event;
Attendee = attendee;
Attendee.attend();
}, {
Attendee: {
attend: function(){
this.attendedEvents.push(Event);
Event.trackAttendence();
func (w *Writer) WriteString(input string) (int, error) {
total := 0
for len(input) > w.Available() && w.err == nil {
wrote := w.writeChunk(input)
total += wrote
input = input[wrote:]
w.flush()
}
if w.err != nil {
// State Machine Library
function Machine(first, $){
var cur = {}, next = $[first];
var self = {
go: function(to){ next = next ? next : ($[to] || $.undefined); },
trigger: function(event){ var t = cur.tx && cur.tx[event]; t && self.go(t); }
};
return function(){
if(next){
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"sort"
"strings"
"time"
package main
import (
"fmt"
"gopkg.in/tomb.v2"
)
type Pipeline struct {
tomb.Tomb
package main
import (
"fmt"
"sync"
)
type errors []error
func (e errors) Error() string {
package set
type Hash int64
type Elem interface {
Hash() Hash
Equals(e Elem) bool
}
type Set struct {
buckets map[Hash][]Elem
From "Applicability Statement for Secure Health Transport" at 2.1 it says that
A Health Content Container (prior to signing and encrypting, as otherwise described in
this document) SHALL be an Internet Message Format document conforming to RFC 5322.
Now the Unwrapped message, as sent out by TTT, is not a proper IMF, it is missing the necessary headers.
The specification says that we must implement the following. (I'm using mathy notation because it will be easier to follow than words)
First we have an HCC: [2.1]