anchor.diff:  % Return any of the existing StreamID
   % plus an unassgined one for testing
   streamid(#state{streams = []}) ->
  -    1;
  +%    1;
  +    elements([1,2,3]);
   streamid(#state{streams = Streams}) ->
       IDs = [X || {X,_,_} <- Streams],
       elements([lists:max(IDs)+1|IDs]).
  
positive.code:     tcp_query(?HOST,?PORT,packet(?APPEND,Message)).
  
  simple_query(StreamID,Start,End) ->
  %    Message = list_to_binary([ <<StreamID:16>>, <<Start:64>>, <<End:64>>]),
      Message = list_to_binary([ <<StreamID:16>>, Start, End]),
      tcp_query(?HOST,?PORT,packet(?QUERY,Message)).
  
  all_since(StreamID,Time) ->
      Message = list_to_binary([ <<StreamID:16>>, Time]),
  %    Message = list_to_binary([ <<StreamID:16>>, <<Time:64>>]),
      tcp_query(?HOST,?PORT,packet(?ALL_SINCE,Message)).
  
  request_stream(StreamName) ->
  
negative.code: timestamp() ->
          {Mega, Sec, Micro} = now(),
          TS = Mega * 1000000 * 1000000 + Sec * 1000000 + Micro,
          <<TS:64/big-integer>>.
  
  timestamp_wrapper() ->
      {call,?MODULE,timestamp,[]}.
  
  %timestamp() ->
  %    % Returns time in microseconds since epoch
  