anchor.diff:  % {1000000, 1, 0.000001}
   % 
   %%
  -validTS({X,Y,Z}) -> is_integer(X) and
  -                    is_integer(Y) and
  -					is_integer(Z);
  +validTS({X, Y, Z}) -> is_integer(X) and
  +  is_integer(Y) and
  +  is_integer(Z);
   validTS(_SomethingElse) -> %io:format("***>>>>****>>>>~p<<<<<*****<<<<<\n\n",[SomethingElse]),
  -                          false.
  -lessTS({X1,Y1,Z1},{X2,Y2,Z2}) -> 
  -                    (X2 > X1) or
  -					((X2 == X1) and (Y2 > Y1)) or
  -					((X2 == X1) and (Y2 == Y1) and (Z2 > Z1));
  -lessTS(_Something,_Else) -> false.					
  -lessoeqTS({X1,Y1,Z1},{X2,Y2,Z2}) -> 
  -                    (X2 > X1) or
  -					((X2 == X1) and (Y2 > Y1)) or
  -					((X2 == X1) and (Y2 == Y1) and (Z2 >= Z1));
  -lessoeqTS(_Something,_Else) -> false.					
  -equalTS({X1,Y1,Z1},{X2,Y2,Z2}) -> 
  -					((X2 == X1) and (Y2 == Y1) and (Z2 == Z1));
  -equalTS(_Something,_Else) -> false.					
  -diffTS({X1,Y1,Z1},{X2,Y2,Z2}) ->
  -                    {X1-X2,Y1-Y2,Z1-Z2};					
  -diffTS(_Something,_Else) -> {-42,-42,-42}.
  -now2string({Me,Mo,Mi}) ->
  -                    {{_Year, Month, Day},{Hour, Minute, Second}} = calendar:now_to_local_time({Me,Mo,Mi}),	
  -	                Tag = lists:concat([klebe(Day,""),".",klebe(Month,"")," ",klebe(Hour,""),":"]),
  -	                Tag ++ concat([Minute,Second],":") ++ "," ++ toMilliSeconds(Mi)++"|";
  +  false.
  +lessTS({X1, Y1, Z1}, {X2, Y2, Z2}) ->
  +  (X2 > X1) or
  +    ((X2 == X1) and (Y2 > Y1)) or
  +    ((X2 == X1) and (Y2 == Y1) and (Z2 > Z1));
  +lessTS(_Something, _Else) -> false.
  +lessoeqTS({X1, Y1, Z1}, {X2, Y2, Z2}) ->
  +  (X2 > X1) or
  +    ((X2 == X1) and (Y2 > Y1)) or
  +    ((X2 == X1) and (Y2 == Y1) and (Z2 >= Z1));
  +lessoeqTS(_Something, _Else) -> false.
  +equalTS({X1, Y1, Z1}, {X2, Y2, Z2}) ->
  +  ((X2 == X1) and (Y2 == Y1) and (Z2 == Z1));
  +equalTS(_Something, _Else) -> false.
  +diffTS({X1, Y1, Z1}, {X2, Y2, Z2}) ->
  +  {X1 - X2, Y1 - Y2, Z1 - Z2};
  +diffTS(_Something, _Else) -> {-42, -42, -42}.
  +now2string({Me, Mo, Mi}) ->
  +  {{_Year, Month, Day}, {Hour, Minute, Second}} = calendar:now_to_local_time({Me, Mo, Mi}),
  +  Tag = lists:concat([klebe(Day, ""), ".", klebe(Month, ""), " ", klebe(Hour, ""), ":"]),
  +  Tag ++ concat([Minute, Second], ":") ++ "," ++ toMilliSeconds(Mi) ++ "|";
   now2string(_SomethingElse) -> "00.00 00:00:00,000|".
   
  -now2stringD({Me,Mo,Mi}) ->
  -                    {{_Year, _Month, _Day},{_Hour, Minute, Second}} = calendar:now_to_local_time({Me,Mo,Mi}),	
  -	                Tag = lists:concat([klebe(0,""),".",klebe(0,"")," ",klebe(0,""),":"]),
  -	                Tag ++ concat([Minute,Second],":") ++ "," ++ toMicroSeconds(Mi)++"|";
  +now2stringD({Me, Mo, Mi}) ->
  +  {{_Year, _Month, _Day}, {_Hour, Minute, Second}} = calendar:now_to_local_time({Me, Mo, Mi}),
  +  Tag = lists:concat([klebe(0, ""), ".", klebe(0, ""), " ", klebe(0, ""), ":"]),
  +  Tag ++ concat([Minute, Second], ":") ++ "," ++ toMicroSeconds(Mi) ++ "|";
   now2stringD(_SomethingElse) -> "00.00 00:00:00,000|"
   .
  -
  -
  -loadConfig(Configfile) ->
  -	{ok, Config} = file:consult(Configfile),
  -	Config.
  -
  -% for Test purposes
  -ensureNameserviceStarted() ->
  -	ConfigPath = "./test-config/koordinator.cfg",
  -	Config = werkzeug:loadConfig(ConfigPath),
  -	{ok, NSName} = werkzeug:get_config_value(nameservicename, Config),
  -	werkzeug:ensureNameserviceStarted(NSName).
  -
  -% For "production" use
  -ensureNameserviceStarted(Nameservicename) ->
  -	WhereIsName = erlang:whereis(Nameservicename),
  -	case WhereIsName of
  -		undefined -> nameservice:start()
  -	end
  -.
  -
  -register_safe(Name, PID) ->
  -	WhereIsName = erlang:whereis(Name),
  -	case WhereIsName of
  -		undefined -> register(Name, PID)
  -	end
  -.
positive.code: %                  	{ok, Lifetime} = get_config_value(lifetime, ConfigListe),
  %
  get_config_value(Key, []) ->
  	{nok, Key};
  get_config_value(Key, [{Key, Value} | _ConfigT]) ->
  	{ok, Value};
  get_config_value(Key, [{_OKey, _Value} | ConfigT]) ->
  	get_config_value(Key, ConfigT).
  
  %% -------------------------------------------
  % Schreibt auf den Bildschirm und in eine Datei
  % nebenläufig zur Beschleunigung
  % Beispielaufruf: logging('FileName.log',"Textinhalt"),
  %
  logging(Datei,Inhalt) -> Known = erlang:whereis(logklc),
  						case Known of
  						undefined -> 
  								PIDlogklc = spawn(fun() -> logloop(0) end),
  								% catch fuer nebenlaeufigen Zugriff
  								_Error = (catch erlang:register(logklc,PIDlogklc));
  								_NotUndef -> ok
  						end,
  						logklc ! {Datei,Inhalt},
  						ok.
  
  logstop( ) -> 	Known = erlang:whereis(logklc),
  				case Known of
  					undefined -> false;
  					_NotUndef -> logklc ! kill, true
  				end.
  					
  logloop(Y) -> 	receive
  					{Datei,Inhalt} -> io:format(Inhalt),
  									  file:write_file(Datei,Inhalt,[append]),
  									  logloop(Y+1);
  					kill -> true
  				end.
  
  %% -------------------------------------------
  %%
  % Unterbricht den aktuellen Timer
  % und erstellt einen neuen und gibt ihn zurück
  %%
  reset_timer(Timer,Sekunden,Message) ->
  	case timer:cancel(Timer) of
  		{error, _Reason} ->
  				neu;
  		{ok, cancel} ->
  				alt
   	end,
  	{ok,TimerNeu} = timer:send_after(Sekunden*1000,Message),
  	TimerNeu.
  	
  %% Zeitstempel: 'MM.DD HH:MM:SS,SSS'
  % Beispielaufruf: Text = lists:concat([Clientname," Startzeit: ",timeMilliSecond()]),
  %
  timeMilliSecond() ->
  	{_Year, Month, Day} = date(),
  	{Hour, Minute, Second} = time(),
  	Tag = lists:concat([klebe(Day,""),".",klebe(Month,"")," ",klebe(Hour,""),":"]),
  	{_, _, MicroSecs} = erlang:timestamp(),
  	Tag ++ concat([Minute,Second],":") ++ "," ++ toMilliSeconds(MicroSecs)++"|".
  toMilliSeconds(MicroSecs) ->
  	Seconds = MicroSecs / ?MILL,
  	%% Korrektur, da string:substr( float_to_list(0.234567), 3, 3). 345 ergibt
  	if (Seconds < 1) -> CorSeconds = Seconds + 1;
  	   (Seconds >= 1) -> CorSeconds = Seconds
  	end,
  	string:substr( float_to_list(CorSeconds), 3, 3).
  toMicroSeconds(MicroSecs) ->
  	Seconds = MicroSecs / ?MILL,
  	%% Korrektur, da string:substr( float_to_list(0.234567), 3, 3). 345 ergibt
  	if (Seconds < 1) -> CorSeconds = Seconds + 1;
  	   (Seconds >= 1) -> CorSeconds = Seconds
  	end,
  	string:substr( float_to_list(CorSeconds), 3, 7).
  
  	% als Millisecond
  getUTC() ->
  	{MegaSecs, Secs, MicroSecs} = erlang:timestamp(),
  	% MicroSecs ist eine Zahl der Form ***000, deshalb div 1000
  	((((MegaSecs * ?MILL) + Secs) * ?TAUS) + (MicroSecs div ?TAUS)).
  
  compareUTC(UTC1,UTC2) ->
  	case (UTC1 - UTC2) of
  		X when X > 0 -> afterw;
  		X when X < 0 -> before;
  		X when X == 0 -> concurrent
  	end.
  
  now2UTC({MegaSecs, Secs, MicroSecs}) -> 	
  	((((MegaSecs * ?MILL) + Secs) * ?TAUS) + (MicroSecs div ?TAUS));
  now2UTC(UTCtimestamp) ->
  	UTCtimestamp.
  	
  compareNow({MegaSecs1,Secs1,MicroSecs1},{MegaSecs2,Secs2,MicroSecs2}) ->
  	Val1 = MegaSecs1 - MegaSecs2,
  	if Val1 > 0 -> afterw;
  	   Val1 < 0 -> before;
  	   Val1 == 0 -> 
  			Val2 = Secs1 - Secs2,
  			if Val2 > 0	-> afterw;
  			   Val2 < 0 -> before;
  			   Val2 == 0 -> 
  					Val3 = MicroSecs1 - MicroSecs2,
  					if Val3 > 0 -> afterw;
  					   Val3 < 0 -> before;
  					   Val3 == 0 -> concurrent
  					end
  			end
  	end.
  	
  concat(List, Between) -> concat(List, Between, "").
  concat([], _, Text) -> Text;
  concat([First|[]], _, Text) ->
  	concat([],"",klebe(First,Text));
  concat([First|List], Between, Text) ->
  	concat(List, Between, string:concat(klebe(First,Text), Between)).
  klebe(First,Text) -> 	
  	NumberList = integer_to_list(First),
  	string:concat(Text,minTwo(NumberList)).	
  minTwo(List) ->
  	case {length(List)} of
  		{0} -> ?ZERO ++ ?ZERO;
  		{1} -> ?ZERO ++ List;
  		_ -> List
  	end.
  
  %% -------------------------------------------
  % Ermittelt den Typ
  % Beispielaufruf: type_is(Something),
  %
  type_is(Something) ->
      if is_atom(Something) -> atom;
  	   is_binary(Something) -> binary;
  	   is_bitstring(Something) -> bitstring;
  	   is_boolean(Something) -> boolean;
  	   is_float(Something) -> float;
  	   is_function(Something) -> function;
  	   is_integer(Something) -> integer;
  	   is_list(Something) -> list;
  	   is_number(Something) -> number;
  	   is_pid(Something) -> pid;
  	   is_port(Something) -> port;
  	   is_reference(Something) -> reference;
  	   is_tuple(Something) -> tuple
  	end.
  	
  % Wandelt in eine Zeichenkette um
  % Beispielaufruf: to_String(Something),
  %
  to_String(Etwas) ->
  	lists:flatten(io_lib:format("~p", [Etwas])).	
  
  % Oeffnen von UDP Sockets, zum Senden und Empfangen 
  % Schliessen nicht vergessen: timer:apply_after(?LIFETIME, gen_udp, close, [Socket]),
  
negative.code: shuffle(List) -> shuffle(List, []).
  shuffle([], Acc) -> Acc;
  shuffle(List, Acc) ->
    {Leading, [H | T]} = lists:split(rand:uniform(length(List)) - 1, List),
    shuffle(Leading ++ T, [H | Acc]).
  
  
  %% -------------------------------------------
  %
  % initialisiert die Mi der ggT-Prozesse, um den
  