anchor.diff:  handle_call(_Unknown, _From, State) ->
       {reply, ok, State}.
   
  -get_data2(Bucket) -> Bucket.
  +get_data2(#bucket{tab = T}) ->
  +    ets:tab2list(T).
   
   handle_info(_Unknown, State) ->
       {noreply, State}.
  
positive.code: 
  init([]) ->
      %Tab = ets:new(sensor_dir_table, [{keypos,2}]),
      {ok, #state{tabs=orddict:new()}}.
  
  handle_cast({add_data, Data = {Sensor, Type, _Value, _Time}}, State) ->
      Buckets = State#state.tabs,
      OldBucket = get_or_create_bucket({Sensor, Type}, Buckets),
      NewBucket = bucket_add_data(OldBucket, Data),
      NewBuckets = store_bucket(Buckets, {Sensor, Type}, NewBucket),
      NewState = State#state{tabs=NewBuckets},
      {noreply, NewState};
  handle_cast(stop, State) ->
      {stop, normal, State}.
  
  get_or_create_bucket(Key, Buckets) ->
      Bucket = orddict:find(Key, Buckets),
      case Bucket of
          error -> [];
          {ok, B} -> B
      end.
  
  bucket_add_data(OldBucket, Data) ->
      [Data | OldBucket].
  
  store_bucket(Buckets, Key, Bucket) ->
      orddict:store(Key, Bucket, Buckets).
  
negative.code: -define(SERVER, ?MODULE).
  
  -record(state, {tabs}).
  -record(bucket, {timestamp,
                   tab}).
  
  start_link(Args) ->
      gen_server:start_link({local, ?SERVER}, ?MODULE, Args, []).
  